Skip to content
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

Remove (node:86710) ExperimentalWarning: The ESM module loader is experimental. #30213

Closed
haraldrudell opened this issue Nov 2, 2019 · 15 comments
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features. question Issues that look for answers.

Comments

@haraldrudell
Copy link

haraldrudell commented Nov 2, 2019

Could we remove the ESM warning, please?

--no-warnings affects Node.js behavior, so that can't be used
For people who write shell executables there's a bloody extra line being output requiring trickery
ESM is so unexperimental since 190423

$ node --experimental-modules src/fsPromisesUtimes.js
(node:86710) ExperimentalWarning: The ESM module loader is experimental.
@devsnek
Copy link
Member

devsnek commented Nov 2, 2019

esm is still experimental though. the warning will be removed when it isnt.

@guybedford
Copy link
Contributor

Currently the PR to unflag at #29866 which we are hoping to land soon would still output this warning whenever loading an ES module or using a custom loader.

Ideally we would have a nicer way to filter these warnings, but unfortunately it seems these will be around for a little while still.

Stability could be early next year, with the warning removal then. Getting the warning message removed sooner could be something worth considering though if enough people want it.

@devsnek
Copy link
Member

devsnek commented Nov 2, 2019

closing as answered

@devsnek devsnek closed this as completed Nov 2, 2019
@devsnek devsnek added esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features. question Issues that look for answers. labels Nov 2, 2019
@Alhadis
Copy link
Contributor

Alhadis commented Dec 3, 2019

Currently the PR to unflag at #29866 which we are hoping to land soon would still output this warning whenever loading an ES module or using a custom loader.

@guybedford Just curious, what's the reason for that? I imagined that once --experimental-modules was unflagged, the warning would disappear because ESM imports would be deemed a stable feature.

@sheerun
Copy link

sheerun commented Jan 14, 2020

flag is not there but it's still experimental, which means you should not use it in production yet

@sheerun
Copy link

sheerun commented Jan 14, 2020

(or publish any node module that uses es6 modules that is meant to be used with node)

@ghost
Copy link

ghost commented May 28, 2020

Question: Is the esm module loader a new feature in nodejs?

@rulatir
Copy link

rulatir commented Dec 9, 2020

Any progress on this?

@valyrie97
Copy link

the options is no longer --experimental-loader, its just --loader, but produces the same warning. surely this is an oversight, in some capacity? either it is still experimental, and should not have changed its name, (or maybes its just aliased, if so, it shouldnt be, as to not give false hope, that its no longer experimental), or it isnt experimental, in which case, this warning should not be present.

@Fil Fil mentioned this issue Jun 29, 2022
4 tasks
@andrewshawcare
Copy link

andrewshawcare commented Jun 12, 2023

Can we at least change the warning to:

Warning: Custom ESM Loaders is a feature and might change at any time

and then add a flag:

NODE_OPTIONS=--suppress-warnings-about-features-that-might-change

@rulatir
Copy link

rulatir commented Jun 15, 2023

Is this still an issue? If so, why is the issue closed?

@drernie
Copy link

drernie commented Sep 30, 2023

I'm seeing an even more confusing version of this:

(node:28745) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("ts-node/esm", pathToFileURL("./"));'
    at createModuleLoader (node:internal/modules/esm/loader:534:17)
    at loadESM (node:internal/process/esm_loader:21:19)
    at runMainESM (node:internal/modules/run_main:53:21)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:5)
    at node:internal/main/run_main_module:23:47

when I call 'loader=ts-node/esm' with mocha:

  "node-option": [
      "experimental-specifier-resolution=node",
      "loader=ts-node/esm"
  ],

@aggarwalmegha
Copy link

Same any fix?

@andrewshawcare
Copy link

This error is getting kind of wild.

If the use case is the CLI, why is the suggested fix to drop into a script (or some kind of dynamic eval at the CLI)?

At the context of some (if not all) warnings, there is no register() function option because there is no code being written.

Why not suggest --loader or --register CLI options? Why should people using loaders have to write wrapper scripts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

11 participants