Skip to content

Commit

Permalink
Merge pull request #536 from preactjs/chore/webpack-nextjs-error
Browse files Browse the repository at this point in the history
chore: Swap out NextJS Webpack error with something more generic
  • Loading branch information
rschristian authored Mar 23, 2024
2 parents 018f5cc + 28eb8d5 commit ea6a3df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-eagles-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@prefresh/webpack': patch
---

Swap out NextJS-specific error message in the Webpack package for something more generic
7 changes: 2 additions & 5 deletions packages/webpack/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,9 @@ class ReloadPlugin {

if (internalWebpackVersion !== externalWebpackVersion) {
throw new Error(`
Next is using webpack-version ${internalWebpackVersion} and you have ${externalWebpackVersion} installed.
You are using webpack v${internalWebpackVersion} and yet you have v${externalWebpackVersion} installed, which Prefresh is pulling.
Try installing ${
compiler.webpack ? compiler.webpack.version : 4
} locally.
Or if you want to try webpack 5 you can turn this on with { future: { webpack5:true } } in you next.config.js.
You may want to uninstall v${externalWebpackVersion} if possible, set overrides so that you only have v${internalWebpackVersion} available, or fix your lockfile to correct this.
`);
}

Expand Down

0 comments on commit ea6a3df

Please sign in to comment.