Versions
- nuxt-edge: 2.16.0-27720022.54e852f
- node: v16.17.0
Reproduction
Additional Details
Steps to reproduce
- Use latest nuxt-edge version
nuxt.config.js with target: 'static' and ssr: true
- Running nuxt build fails with
ERROR in ./node_modules/node-fetch-native/dist/index.cjs 69:2
Module parse failed: Unexpected character '#' (69:2)
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
| */
| class BlobDataItem {
> #path
| #start
|
@ ./node_modules/node-fetch-native/lib/index.cjs 1:18-46
@ ./.nuxt/server.js
@ multi ./node_modules/@nuxt/components/lib/installComponents.js ./.nuxt/server.js
What is Expected?
- Running nuxt build should be successful
What is actually happening?
- Seems like the
node-fetch-native dependency used to be just node-fetch
- This new dependency includes private methods syntax and webpack/eslint don’t know how to deal with that? Maybe it needs to be transpiled?
You could also add a alias from node-fetch-native back to node-fetch when using
v2.16.x:Pin your Nuxt version to
"nuxt": "2.15.7"I had the same problem with Vercel. Manually adding
node-fetch-nativeto the dependencies fixed the problem for me. Also runs flawlessly with Node 18.I’m running into the same problem. Though I’m not using
target: 'static'andssr: true.Local
devandbuildcommands work just fine, but I’m getting this error just at Vercel.I add
node-fetch-nativeas normal package and it fix the issueAdding
node-fetch-nativeto my dependencies did not fix the problem fornuxt@2.17.1This should be resolved in the edge channel after tonight’s nightly build, or in the next release.
Let me know if not and I’ll reopen.
Is there a solution for that? Got the same problem when deploying on Vercel
Solution did not work for me, any other recommendations?
Node: 16.16.0 Nuxt: 2.15.7
Worked for me for now.
Pinning to 2.15.8 seems to work for our team too.