craco: [Bug]Error: Cannot find module './node_modules/react-scripts/config/webpack.config.dev' with react-script v2.1.2
Cannot find webpack config with react-scripts 2.1.2
I have updated my react-scripts dependencies from 2.1.1 to 2.1.2 and got the following error on both npm start and npm run build:
Error: Cannot find module /node_modules/react-scripts/config/webpack.config.dev'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.resolve (internal/modules/cjs/helpers.js:32:19)
at resolveConfigFilePath (/node_modules/@craco/craco/lib/cra.js:7:20)
at getWebpackDevConfigPath (/node_modules/@craco/craco/lib/cra.js:25:12)
at loadWebpackDevConfig (/node_modules/@craco/craco/lib/cra.js:29:22)
at Object.<anonymous> (/node_modules/@craco/craco/scripts/start.js:18:26)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
Expect
to start or build my unjected create-react-app.
Result
Can’t find the configuration react-scripts/config/webpack.config.dev
Seems obvious: https://github.com/facebook/create-react-app/tree/v2.1.2/packages/react-scripts/config
Version
- Craco: 3.2.3
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 39
- Comments: 29 (3 by maintainers)
Fix with https://www.npmjs.com/package/@craco/craco/v/3.3.1
Sorry for the very long delay.
Hi,
Sorry for the delay, I had an accident and couldn’t use a computer for a few weeks.
I’ll make sure https://github.com/sharegate/craco/pull/62 is merged and release soon.
@patricklafrance, please merge @hckhanh’s solution
+1 👎
+1
No, why should you ? This project is not based on react-app-rewired and this issue is still there. We are still waiting for https://github.com/sharegate/craco/pull/62 to be merged.
@kopax While I understand the need for you to move for
react-app-rewired, I think this issue should’ve kept opened until the fix is landed. It helps the maintainer and others to keep track, and be aware that this is still an issue incraco.+1
Referencing the issue that introduced this problem: https://github.com/facebook/create-react-app/pull/5722
+1
The way CRA organizes webpack configs seems to have changed with this commit: https://github.com/facebook/create-react-app/commit/30ee52cf3b2cbb6ac70999c02b1196bcaba8d4ca#diff-ee7ca784a2ec9d96668503d6394bdd62
+1
+1
FWIW, I opened https://github.com/sharegate/craco/issues/67 to keep this issue visible for the maintainer and future readers
Where is @patricklafrance? 😑
+1