Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]Error: Cannot find module './node_modules/react-scripts/config/webpack.config.dev' with react-script v2.1.2 #61

Closed
kopax opened this issue Dec 23, 2018 · 29 comments · Fixed by #62

Comments

@kopax
Copy link

kopax commented Dec 23, 2018

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
@ClaudiuCeia
Copy link

The way CRA organizes webpack configs seems to have changed with this commit: facebook/create-react-app@30ee52c#diff-ee7ca784a2ec9d96668503d6394bdd62

@tzarger
Copy link

tzarger commented Dec 24, 2018

+1

2 similar comments
@Delphier
Copy link

+1

@zhnoah
Copy link

zhnoah commented Dec 24, 2018

+1

@hckhanh
Copy link
Contributor

hckhanh commented Dec 24, 2018

+1 👎

@r17x
Copy link

r17x commented Dec 24, 2018

+1

@neodon
Copy link

neodon commented Dec 24, 2018

Referencing the issue that introduced this problem: facebook/create-react-app#5722

@Gamezpedia
Copy link

+1

@nanxiaobei
Copy link

Still not upgraded

@SergeyVolynkin
Copy link

SergeyVolynkin commented Dec 26, 2018

@patricklafrance, please merge @hckhanh's solution

@tangdw
Copy link

tangdw commented Jan 5, 2019

windows => Error: Cannot find module 'E:\react-start\node_modules\react-scripts/config/webpack.config.dev' ????????????????

switch to https://github.com/rescripts/rescripts

@kopax
Copy link
Author

kopax commented Jan 5, 2019

Why did you switch ? Isn't this already fixed with #6 ? What's the benefits of changing again (I was react rewire user just before using craco two weeks ago)

@tzarger
Copy link

tzarger commented Jan 6, 2019

@kopax What does #6 have to do with this issue?

@kopax
Copy link
Author

kopax commented Jan 6, 2019

Sorry I meant DocSpring/craco-less#6 , I guessed that from the title.

@kopax
Copy link
Author

kopax commented Jan 6, 2019

Seems like react-app-rewired is now release for react-scripts 2.1.2, should I close this?

@abenhamdine
Copy link

abenhamdine commented Jan 7, 2019

Seems like react-app-rewired is now release for react-scripts 2.1.2, should I close this?

No, why should you ? This project is not based on react-app-rewired and this issue is still there.
We are still waiting for #62 to be merged.

@ZKHelloworld
Copy link

+1

@nanxiaobei
Copy link

Where is @patricklafrance? 😑

@kopax
Copy link
Author

kopax commented Jan 10, 2019

I can tell not here and I just hop nothing bad for him. Did/may someone release the #62 under a scoped name?

@tahamshahzad
Copy link

@kopax
Copy link
Author

kopax commented Jan 15, 2019

Hi, you are rescripts author? I am sorry to say that but we had to give up craco for react-app-rewired. They support the latest version.

We also found that editing webpack.resolve.alias was failing with craco while succeeded with react-app-rewired. I don't know about rescripts, but both react-app-rewired and craco have a busy maintainer, it's a good thing to have a 3rd options. Perhaps you should nominate also one contributor because fixing broken versions generally take less than 10 minutes.

@kopax kopax closed this as completed Jan 15, 2019
@panjiesw
Copy link

panjiesw commented Jan 15, 2019

@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 in craco.

@Delphier
Copy link

Delphier commented Jan 15, 2019

@kopax plz don't close.

@SergeyVolynkin
Copy link

"Giving up" – is not a good reputation for the https://sharegate.com/ team.

I think current users of craco will be much happier if you just:

  • Merge @hckhanh's PR to fix the bug
  • Assign new maintainer for this project from the community.

cc @kopax @patricklafrance

@abenhamdine
Copy link

FWIW, I opened #67 to keep this issue visible for the maintainer and future readers

@kopax kopax reopened this Jan 15, 2019
@ltfschoen
Copy link

so will we be continuing to close and re-open this issue multiple times just to encourage others to create multiple duplicates of the same issue to spam the maintainers?

@patricklafrance
Copy link
Contributor

patricklafrance commented Jan 17, 2019

Hi,

Sorry for the delay, I had an accident and couldn't use a computer for a few weeks.

I'll make sure #62 is merged and release soon.

@patricklafrance
Copy link
Contributor

Fix with https://www.npmjs.com/package/@craco/craco/v/3.3.1

Sorry for the very long delay.

@Delphier
Copy link

@patricklafrance thanks.

ltfschoen added a commit to openethereum/fether that referenced this issue Jan 19, 2019
See dilanx/craco#61.
Updating to craco 3.3.1 resolves error when trying to install dependencies and build:
```
Error: Cannot find module '~/code/src/paritytech/fether/node_modules/react-scripts/config/webpack.config.dev'
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.