Getting the below error in React app,
Failed to compile. ./node_modules/react-dev-utils/formatWebpackMessages.js Module not found: Can't resolve 'E:\project\ruchkarsolapurwbt\frontend\pwa\node_modules\babel-preset-react-app\node_modules@babel\runtime/helpers/slicedToArray' in 'E:\project\ruchkarsolapurwbt\frontend\pwa\node_modules\react-dev-utils'
Please help me to resolve it
Getting the below error in React app,
Failed to compile. ./node_modules/react-dev-utils/formatWebpackMessages.js Module not found: Can't resolve 'E:\project\ruchkarsolapurwbt\frontend\pwa\node_modules\babel-preset-react-app\node_modules@babel\runtime/helpers/slicedToArray' in 'E:\project\ruchkarsolapurwbt\frontend\pwa\node_modules\react-dev-utils'
Please help me to resolve it
Share Improve this question edited Apr 5, 2020 at 1:36 Brian Burns 22k10 gold badges92 silver badges79 bronze badges asked Sep 10, 2019 at 18:04 manali patilmanali patil 311 silver badge2 bronze badges 5 |3 Answers
Reset to default 18I have the same issue, I resolved my deleting my node_modules folder and running npm install again.
I have had the same issue. Try to fix the issue by running:
npm add @babel/runtime
and then:
npm start
I had similar issue with pnpm. Build worked locally but was failing on Netlify with:
Module not found: Error: You attempted to import /opt/build/repo/node_modules/.pnpm/@[email protected]/node_modules/@babel/runtime/helpers/esm/slicedToArray.js which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
I have solved it by adding in .npmrc
:
hoist-pattern[]=@babel/runtime
and adding @babel/runtime
to production dependencies (no -D flag!)
pnpm add @babel/runtime
npx create-react-app my-app
. Running that with the most recent versions of Node will do exactly what it needs to do. So: did you run that command, or did you install things yourself, in a completely different way? – Mike 'Pomax' Kamermans Commented Sep 11, 2019 at 17:35