Issue with next-plugin-preact
See original GitHub issueAn issue vercel/next.js#26826 was brought up in the next.js repo where using Next.js 11 with webpack 5 seems to break the using-preact example.
Error: Cannot find module 'webpack/lib/dependencies/ConstDependency'
Require stack:
- /home/projects/nextjs-preact-webpack5-a4fygy/node_modules/@prefresh/webpack/src/index.js
- /home/projects/nextjs-preact-webpack5-a4fygy/node_modules/@prefresh/next/src/index.js
- /home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next-plugin-preact/index.js
- /home/projects/nextjs-preact-webpack5-a4fygy/next.config.js
- /home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/next-server/server/config.js
- /home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/server/next.js
- /home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/server/lib/start-server.js
- /home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/cli/next-dev.js
- /home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (https://nextjs-preact-webpack5-a4fygy.jw.staticblitz.com/blitz.70a1ff62a0f0131ac0df3c30faf487fef744ac90.js:6:189728)
at Function.mod._resolveFilename (/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/build/webpack/require-hook.js:4:1855)
at Function.Module._resolveFilename (/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/module-alias/index.js:49:29)
at Function.Module._load (https://nextjs-preact-webpack5-a4fygy.jw.staticblitz.com/blitz.70a1ff62a0f0131ac0df3c30faf487fef744ac90.js:6:187342)
at Module.require (https://nextjs-preact-webpack5-a4fygy.jw.staticblitz.com/blitz.70a1ff62a0f0131ac0df3c30faf487fef744ac90.js:6:190516)
at i (https://nextjs-preact-webpack5-a4fygy.jw.staticblitz.com/blitz.70a1ff62a0f0131ac0df3c30faf487fef744ac90.js:6:477111)
at _0x52c652 (https://nextjs-preact-webpack5-a4fygy.jw.staticblitz.com/blitz.70a1ff62a0f0131ac0df3c30faf487fef744ac90.js:11:190288)
at ReloadPlugin.webpack5 (/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/@prefresh/webpack/src/index.js:60:29)
at ReloadPlugin.apply (/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/@prefresh/webpack/src/index.js:170:14)
at createCompiler (/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/compiled/webpack/bundle5.js:141349:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/@prefresh/webpack/src/index.js',
'/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/@prefresh/next/src/index.js',
'/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next-plugin-preact/index.js',
'/home/projects/nextjs-preact-webpack5-a4fygy/next.config.js',
'/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/next-server/server/config.js',
'/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/server/next.js',
'/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/server/lib/start-server.js',
'/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/cli/next-dev.js',
'/home/projects/nextjs-preact-webpack5-a4fygy/node_modules/next/dist/bin/next'
]
}
I attempted to install webpack5 on its own as a dependency to the package,json file in vercel/next.js#26864 but one of the lead developers suggested that the @prefresh/webpack package is using webpack internals that can’t be required as they’re no longer available.
This issue was mentioned here as well: preactjs/next-plugin-preact#34
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Issues · preactjs/next-plugin-preact - GitHub
Issues : preactjs/next-plugin-preact ... Have a question about this project? Sign up for a free GitHub account to open an issue and contact...
Read more >next-plugin-preact - npm
Preact plugin for Next.js. Latest version: 3.0.7, last published: 7 months ago. Start using next-plugin-preact in your project by running ...
Read more >next-plugin-preact - npm Package Health Analysis - Snyk
The npm package next-plugin-preact was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >Use Preact in Next.js 13 - DEV Community
The key distinction is that Preact lacks several of the experimental features included in React, like Suspense and Concurrent Mode. You have a ......
Read more >Tackling major Next.js upgrades - Turo Engineering - Medium
Through a number of Google searches and some digging, we encountered a Github issue open within next-plugin-preact that mentioned the above error.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Should also be solved by #361
@DeviousLab sorry about that was trying to be a bit too fast https://github.com/preactjs/prefresh/pull/362 has you covered, would you mind testing before I push the release for it? I can’t reproduce the issue 😅