Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module './src/data'

*爱你&永不变心* 提交于 2019-12-10 15:55:33

问题


I'm getting this error when I try to run my app, I'm using all the same dependencies that I always use so I'm very baffled by this. I've tried deleting my package-lock.json and node modules a couple of times and tried searching the whole repo for /src/data and found nothing.

More of the error message:

ERROR in ./src/index.js

Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module './src/data'

and this is the ./src/index.js from the error

import { render } from 'react-dom';
import { Provider } from 'react-redux';
import App from './components/App';
import store from './store';

render(
  <Provider store={store}>
    <App />
  </Provider>, 
  document.getElementById('root')
);```

Anyone have any recommendations?


回答1:


Apparently there's a problem with a live version of core-js-compat dependency. For a quick fix, you can update your package.json using

"core-js-compat": "^3.4.7"


来源:https://stackoverflow.com/questions/59145601/module-build-failed-from-node-modules-babel-loader-lib-index-js-error-cann

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!