-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Next 10.0.6 , Build Error: Cannot find module 'webpack' #151
Comments
I also have this problem too! |
I also have this problem too! |
Same issues with my builds in GitHub Actions. This does not happen with local cached builds, but a new build always fails. |
So I just updated, and I have the same issue. But when trying to clear node_modules, package-lock.json and reinstalling, this is the following: npm WARN [email protected] requires a peer of webpack@>=2 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@>=4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^4.4.0 || ^5.9.0 but none is installed. You must install peer dependencies yourself. So, am I reading this correctly that nothing is installing web pack by default and that it's up to the end user to manage this bit? AsideI recall having this moving to version 10.0.5 last time, but cannot recall what actually fixed it. |
This issue also has been reported to Currently Lines 27 to 30 in 9dc7c26
Maybe this commit is related : vercel/next.js@099cd30#diff-9c1a3867443c54525b4f24ef171f231a6e8bb065ffc8b7b62c4843d5ff62dd42L106-L108 Could be cool, if we find a solution for latest version of |
@divlo Thanks for the tip! |
Try to add webpack with following command should help fix this issue:
|
@shadowwalker It solves the issue, but in my opinion |
Totally agree with @divlo that's something that If I'm not mistaken, I think that what's happening here is that |
I do believe that I don't think this repo directly depends on it, but rather only has it as a development dependency, and is relying on the fact that the end user is using NextJS appears to have made the dependency of I see that there are requirements for peer dependencies in this package for @shadowwalker Is there the intention that the end user needs to have workbox installed? Or was it being statisfied as a requirement when NextJS was supplying Webpack and that the user initially didn't notice? (myself included) |
I have no idea what's going on with webpack. I just roll back from |
|
@shadowwalker what I noticed, between 10.0.6 canary-0 (this canary build works) and canary-1 The thing that I noticed is that with I am not sure if there is a way to reference the nextjs version and then declare it for workbox to find. But that would cause a similar issue as now. So that would be bad idea. |
Posted an explanation here: vercel/next.js#21679 (comment) |
With the help of the explanation of @timneutkens I got it to work by adding |
I can confirm that the solution from @timneutkens and @BjoernRave works. In my case, it was necessary to keep Thanks so much! |
so should I downgrade my next version to 10.0.5 ? |
@timneutkens I read your comments here vercel/next.js#21679 (comment), but still couldn't figure out what I should change in |
Same problem.. |
As I had the issue coming from this package and It seems that it will have to do until 10.0.7 of |
I am also facing the same issue. Is there any solution as Webpack solution didn't work for me. |
@tarun1992 maybe try Tim Neutkens suggestion as there is a patch in the canary version of nextjs, vercel/next.js#21679 (comment) |
I tried vercel/next.js#21679 (comment) But it isn't working, I still got the error : Error: Cannot find module 'webpack'
Require stack:
- /home/divlo/Documents/Thream/website/node_modules/workbox-webpack-plugin/build/generate-sw.js
- /home/divlo/Documents/Thream/website/node_modules/workbox-webpack-plugin/build/index.js
- /home/divlo/Documents/Thream/website/node_modules/next-pwa/index.js
...
etc. |
Facing the same issue with next 10.0.7 |
I have fixed it by install webpack@4 in 10.0.7... |
Facing the same issue with next 10.0.1 (!) |
I am still getting this issue with next v 10.0.7. I added a
|
The issue is fixed at Next Fixed at: vercel/next.js#22583 |
Yes, I think we can close this issue now. |
Great, glad the issue is fixed with |
I have to remove
|
Summary
Next 10.0.6 , Build Error: Cannot find module 'webpack'
How To Reproduce
yarn build with.:
The text was updated successfully, but these errors were encountered: