Open EightR0ad opened 2 years ago
... how is this 'completed'? how did this get resolved? Having this issue right now.
The node:
scheme is a relatively recent addition. If I read correctly, it has meanwhile been backported to several earlier Node versions, but might still require updating Node.js.
sure, using node 16, it seems to be a problem on the webpack side not on the node side.
Projects deployed by Vercel
also have this problem.
But it works fine in my local environment using Node.js 18.x
.
Hi @xgqfrms Have you fixed this error? I'm facing this and have no idea how to fix this.
node.js 18.x
nextjs 13.x
The bug happened when I run yarn run build
or deployed on Vercel
still facing this issue too
Did any of you get a viable solution?
Any solution for this?
Same error!
I'm still having this issue, any solution yet?
I am also having this problem! Not sure why the issue is closed.
Can't you set the resolve.fallback["node:fs/promises"]
property to be false
? (see here)
If this problem is so common, perhaps we should just remove the node:
here?
@CountBleck That doesn't work because of this webpack bug. I also tried some of the workarounds discussed in that thread, like externals['node:fs/promises'] = 'commonjs2 node:fs/promises'
and some variations on that theme, with no success.
@dcodeIO I tried removing node:
from my generated bindings file and that resolved the issue. I'd rather not strip that out manually every time I build, so that upstream fix seems like a good solution to me. I don't know how that would impact Node use cases though.
Edit: I also had to set resolve.fallback.fs
to false
in my webpack config.
Okay, sorry for the spam — I found a solution that works with the bindings code as-is. I was close earlier... I needed to make the following additions to my webpack config:
{
...
externals: {
'node:fs/promises': 'commonjs2 node:fs/promises',
},
resolve: {
fallback: {
fs: false
}
}
}
I had tried this earlier and was getting another error which I didn't realize was unrelated. (It was a runtime error caused by the browser trying to resolve that same import, which should be unreachable in that context... turns out it wasn't, because the WebAssembly.compileStreaming()
call in the try
block was failing, because my CSP didn't include 'unsafe-eval'
.) Hope this information is helpful to others.
@Ginowine Does the above work for you?
getting an error when using webpack import build file(debug.js):
import code:
next is webpack configuration: