Pull-Request-Community / pull-request-community-website

Pull request community
https://pullrequest.co.il/
MIT License
56 stars 100 forks source link

Upgrade Next.js to 10.1 and enable Webpack 5 #104

Closed urish closed 2 years ago

urish commented 3 years ago

This should make the project run faster (in dev mode), speed up npm install and make node_modules smaller.

Background info: https://nextjs.org/blog/next-10-1

How to enable webpack 5: https://nextjs.org/docs/messages/webpack5

In a nutshell:

  1. Update next.js version in package.json
  2. Add a few lines to next.config.js, as explained here
  3. Check that everything is working
EladTal14 commented 3 years ago

Hi Uri, I can take this one.

urish commented 3 years ago

Go for it :)

EladTal14 commented 3 years ago

Hi Uri, I Read the docs about both things and added a next.config.js file and followed the instructions, but I'm getting a warning that I haven't found a solution for tell me if you know this one. warning webpack5 @urish

urish commented 3 years ago

Hmm there's an open issue about this:

https://github.com/vercel/next.js/issues/23533

Sounds like it's only a warning and it should still work, but you can try asking on that issue if anybody found a solution or a workaround

EladTal14 commented 3 years ago

Awesome I will. also posted on stackoverflow.

domosedov commented 3 years ago

Hi Uri, I Read the docs about both things and added a next.config.js file and followed the instructions, but I'm getting a warning that I haven't found a solution for tell me if you know this one. warning webpack5 @urish

rm -rf node_modules && npm i helped me fix it

EladTal14 commented 3 years ago

Tried your solution but the warning still comes up, did you do anything else or found diffrent solution. @domosedov

phibersoft commented 3 years ago

I m getting this warning too. I deleted package-lock.json and node modules folder and still getting.

Is any different solutions?

image

EladTal14 commented 3 years ago

Just talked with the guys in webpack they said they will fix this bug after their holidays. He said its just a warning our build will work but persistent caching won't work. @urish

urish commented 3 years ago

Thanks!

urish commented 3 years ago

Note: Next.js 10.2 has just been released and should fix the Webpack issue. So let's upgrade to 10.2