react-block-ui icon indicating copy to clipboard operation
react-block-ui copied to clipboard

In combination with MUI and rematch I am getting: Module not found: Can't resolve 'react-block-ui/reduxMiddleware' in

Open josoroma-zz opened this issue 4 years ago • 3 comments

store.js

import { init } from '@rematch/core';
import createPersistPlugin from '@rematch/persist';
import { routerMiddleware, connectRouter } from 'connected-react-router';
import { createBrowserHistory } from 'history';

import reduxMiddleware from 'react-block-ui/reduxMiddleware'; // only for redux

import * as models from 'models';

export const history = createBrowserHistory();

const persistPlugin = createPersistPlugin({
  blacklist: [
    'persist',
  ],
  whitelist: [
    'user',
    ...
  ],
});

export default init({
  models,
  plugins: [persistPlugin],
  redux: {
    reducers: {
      router: connectRouter(history),
    },
    middlewares: [
      reduxMiddleware,
      routerMiddleware(history),
    ],
  },
});

Error

image

Double checking package installation

image

josoroma-zz avatar Feb 29 '20 20:02 josoroma-zz

try import reduxMiddleware from 'react-block-ui/lib/reduxMiddleware';

TheSharpieOne avatar Mar 02 '20 19:03 TheSharpieOne

try import reduxMiddleware from 'react-block-ui/lib/reduxMiddleware';

Thank you! I was running with a similar issue and this helped me.

jaco9419 avatar Sep 11 '21 00:09 jaco9419

try import reduxMiddleware from 'react-block-ui/lib/reduxMiddleware';

then it would error this:

Could not find a declaration file for module 'react-block-ui/lib/redux'. '.../node_modules/react-block-ui/lib/redux.js' implicitly has an 'any' type. If the 'react-block-ui' package actually exposes this module, try adding a new declaration (.d.ts) file containing declare module 'react-block-ui/lib/redux';

Rezaraki avatar Feb 07 '23 14:02 Rezaraki