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

[Case Study] does load esm modules supported? #1237

Closed
zdm opened this issue Apr 22, 2020 · 1 comment
Closed

[Case Study] does load esm modules supported? #1237

zdm opened this issue Apr 22, 2020 · 1 comment
Assignees
Labels
case study Package compatibility report

Comments

@zdm
Copy link

zdm commented Apr 22, 2020

Hi.
Node 14 was release, esm warning was removed.
Does yarn supported load es modules?
I tried to add type = module to package json and got error.

internal/modules/cjs/loader.js:1201
      throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
      ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: d:\downloads\111\1.js
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1201:13)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.module_1.Module._load (d:\downloads\111\.pnp.cjs:10899:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'ERR_REQUIRE_ESM'
}

I am doing something wrong or yarn just not supported this feature?

I am using yarn rc-32.

@zdm zdm added the case study Package compatibility report label Apr 22, 2020
@arcanis
Copy link
Member

arcanis commented Apr 22, 2020

Duplicate of #638 - not yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
case study Package compatibility report
Projects
None yet
Development

No branches or pull requests

2 participants