-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Description
After upgrading cheerio
from v1.0.0-rc.12 to v1.0.0, I started seeing module parse errors in my Nuxt project. Reverting back to v1.0.0-rc.12
fixes the issue, so it seems specific to v1.0.0
.
Error Logs
ERROR in /home/cooperwang/projects/web-project/node_modules/.pnpm/node_modules/encoding-sniffer/dist/commonjs/index.js Module not found: Error: Can't resolve 'node:stream' in '/home/cooperwang/projects/web-project/node_modules/.pnpm/node_modules/encoding-sniffer/dist/commonjs'
ERROR in /home/cooperwang/projects/web-project/node_modules/.pnpm/node_modules/parse5-parser-stream/dist/index.js Module not found: Error: Can't resolve 'node:stream' in '/home/cooperwang/projects/web-project/node_modules/.pnpm/node_modules/parse5-parser-stream/dist'
ERROR in ./node_modules/cheerio/dist/esm/index.js Module not found: Error: Can't resolve 'node:stream' in '/home/cooperwang/projects/web-project/sites/w12/node_modules/cheerio/dist/esm'
ERROR in /home/cooperwang/projects/web-project/node_modules/.pnpm/node_modules/undici/index.js 123:39 Module parse failed: Unexpected token (123:39) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See
https://webpack.js.org/concepts#loaders
Steps to Reproduce
- Install or upgrade to
[email protected]
in a Nuxt 2 project using Webpack 4. - Run
pnpm run dev
orpnpm run build
. - Observe the module parse errors above.
Expected Behavior
The build should succeed without errors, as it does when using [email protected]
.
Environment
- Operating System: Linux
- Node Version: v20.12.2
- Nuxt Version: 2.17.4
- CLI Version: 3.22.5
- Nitro Version: -
- Package Manager: [email protected]
- Builder: webpack 4.47.0
- User Config: -
- Runtime Modules: -
- Build Modules: -
Additional Context
- The error only appears after upgrading to
[email protected]
. - Downgrading to
[email protected]
resolves the issue.
Any guidance or workaround would be greatly appreciated. Thank you!
Chinoman10
Metadata
Metadata
Assignees
Labels
No labels