elmasse / nextein

A static site generator with markdown + react for Next.js
https://nextein.elmasse.io
ISC License
898 stars 34 forks source link

[npm run dev] cannot find module webpack #328

Closed elmasse closed 3 years ago

elmasse commented 3 years ago

next version 10.0.6 no longer ships with webpack (Yup, in a patch release. FGS)

Related: https://github.com/vercel/next.js/issues/21789

workaround: Pin next version to 10.0.5

HartS commented 3 years ago

Following the instructions from the guide, I hit errors when I added webpack to the npm install line. It looks like webpack version 5 is responsible for breaking things. I'm not sure why, because next claims to work with version 5 since it was in Beta. Regardless, pinning webpack to version 4 seems to avoid issues

elmasse commented 3 years ago

Since next v10.0.7 works properly with webpack v4.

Using webpack@5

With nextein@3.0.1 you can use latest webpack:

module.exports = {
    future: {
        webpack5: true
    }
}