-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Node.js 23.x] CJS module gulp-cli\lib\shared\require-or-import.js
is loading ESM gulpfile.js
using require()
#267
Comments
Same issue, same environment |
I have just been experiencing this same issue on MacOS (And in Docker Alpine) with Node |
Node.js See also debug-js/debug#975 which had a similar problem. |
I confirm : with Node 23.4.0, the warning is not displayed anymore. |
Hey, I get that this is fixed for those running 23.4, however 23 isn't on LTS and isn't the default Node version downloaded when navigating to https://nodejs.org/en/download/package-manager. 22.12 is also the Node version used when using any of the Sorry! I may be misunderstanding the linked issue so it may be also resolved in 22.12 too. Thanks. We appreciate everything you do 🙏 |
@mikestreety It should also be fixed in version 22.12.
|
Before you open this issue, please complete the following tasks:
What were you expecting to happen?
Launching a Gulp task doesn't produce any warning.
What actually happened?
Since Node.js v23, an
ExperimentalWarning
is triggered.This is because the
requireOrImport()
function usesrequire()
to check if thegulpfile
is a CommonJS module... but now Node.js allows to userequire()
for loading ES modules. So theERR_REQUIRE_ESM
error is not triggered anymore.See: https://nodejs.org/en/blog/release/v23.0.0
Please give us a sample of your gulpfile
This issue is not related to the content of the
gulpfile
.But feel free to test this project: https://github.com/cedx/lcov.js
Terminal output / screenshots
Please provide the following information:
node -v
): 23.1.0npm -v
): 10.9.0gulp -v
): CLI version: 3.0.0, Local version: 5.0.0Additional information
The launched tasks still run fine (unless the
gulpfile
uses top-levelawait
). There is no runtime error, just anExperimentalWarning
.The text was updated successfully, but these errors were encountered: