Closed flayks closed 3 years ago
This is a breaking change for node versions < 16 when using require, we just downgraded to an earlier version.
@sindresorhus can this please be fixed? because of this the Require Node.js 12.20
is not even true 😞
I'm currently on electron 13 (latest) which is based on node 14.17 having the same error. Electrons next version may also be based on node 14, so upgrading is not an option. Hope for a fix.
SvelteKit is using Vite, and I have Node v14.17.4 installed (latest stable)
This is a problem with Vite and you should open an issue there instead.
This is a breaking change for node versions < 16 when using require, we just downgraded to an earlier version.
Per the release notes, require
is no longer supported.
I'm currently on electron 13 (latest) which is based on node 14.17 having the same error. Electrons next version may also be based on node 14, so upgrading is not an option. Hope for a fix.
You need to open an issue on Electron. This package supports Node.js. When used with Electron, you're on your own.
SvelteKit is using Vite, and I have Node v14.17.4 installed (latest stable)
This is a problem with Vite and you should open an issue there instead.
Most libraries work with Vite (which is based on esbuild btw), even importing with import
, so I think comes to globby changing how it works from v11 to v12?
I'm working in a JS env that does not support ESM (GitHub actions only support Node 12 CJS [1]). My problem isn't that require
is no longer supported -- webpack
handles the conversion just fine -- but that node:fs
is used instead of fs
(https://github.com/sindresorhus/globby/blob/main/index.js#L1). This path format is invalid in CJS below Node 16 even after being processed by webpack
. It's a bit silly to have to sed -i s/node://g
after running webpack
.
[1] Technically GH Actions can support ESM by writing my own Dockerfile but it requires an excessive amount of boilerplate code to hook inputs/outputs with GH's runtime
If you're trying to use webpack to bundle globby 12.0.2 for use from a CommonJS module, the following configuration may help with the broken "node:" imports (cc: @Trinovantes):
"externals": {
"node:fs": "commonjs fs",
"node:path": "commonjs path",
"node:stream": "commonjs stream",
"node:util": "commonjs util"
}
I'm using Globby to find all routes on my SvelteKit site and since the upgrade to version 12, it throws me this error:
SvelteKit is using Vite, and I have Node v14.17.4 installed (latest stable)
My code:
I've never seen the
node:fs
syntax for importing, is that new or is it a typo?