What you were expecting:
By following tutorial at https://marmelab.com/react-admin/CustomApp.html I should be able to configure custom provider.
What happened instead:
Got an exception:
redux.js:567 Uncaught TypeError: middleware is not a function
at redux.js:567
at Array.map (<anonymous>)
at redux.js:566
at <anonymous>:1:28482
at Module.createStore (redux.js:87)
at Object.configureStore [as default] (configure-store.ts:49)
at Object../src/redux.ts (redux.ts:9)
at __webpack_require__ (bootstrap:721)
at fn (bootstrap:98)
at Object../src/index.tsx (index.tsx:7)
at __webpack_require__ (bootstrap:721)
at fn (bootstrap:98)
at Object.0 (serializer.ts:4)
at __webpack_require__ (bootstrap:721)
at ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js.module.exports (bootstrap:788)
at bootstrap:788
Steps to reproduce:
Following the docs for CustomApp.
Related code:
https://github.com/marmelab/react-admin/pull/2249/files#diff-48a1c77367d4a9f0308adfcc0157fc29L17
It seems the middleware was removed and no longer needed.
Environment
Also, it seems the import of formReducer is missing. I guessed it should have been:
import { reducer as formReducer } from 'redux-form'
This is indeed a documentation issue
I think #2339 fixes this, @djhi can you confirm?
Nope, I forgot to remove the formReducer...
For anyone willing to resolve this: we reintroduced the formMiddleware and removed the formReducer which wasn't the one from redux
Hello,
I'm trying to create my own store to access from DataProvider but I think I have a similar problem.
When I try to implement createAdminStore.js as indicated in the documentation, the following error appears when importing formMiddleware
error:
'react-admin' does not contain an export named 'formMiddleware'.
Versiones
React-admin: "2.3.4"
React: "16.5.2"
@DavidEstebanSaiz
I had the same issue and fixed it this way untill a proper patch will be done.
i added formMiddleware this way:
import formMiddleware from 'ra-core/lib/form/formMiddleware';
Seems that this issue still not resolved in 2.4.2, When importing
import { formMiddleware } from 'react-admin';
I am getting:
TypeError: middleware is not a function
When importing it directly from node_modules/ra-core/esm/form/formMiddleware, I am unable to build using CRA scripts with the following error:
Failed to minify the code from this file:
./node_modules/ra-core/src/form/formMiddleware.js:18
Most helpful comment
Seems that this issue still not resolved in 2.4.2, When importing
import { formMiddleware } from 'react-admin';I am getting:
When importing it directly from node_modules/ra-core/esm/form/formMiddleware, I am unable to build using CRA scripts with the following error: