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

node@16.14 import assertions break examples/node-esmodules/example.mjs test #619

Closed
broofa opened this issue Mar 8, 2022 · 1 comment · Fixed by #621
Closed

node@16.14 import assertions break examples/node-esmodules/example.mjs test #619

broofa opened this issue Mar 8, 2022 · 1 comment · Fixed by #621
Assignees

Comments

@broofa
Copy link
Member

broofa commented Mar 8, 2022

@ctavan:

Care to comment (or, better, fix)?

@ctavan
Copy link
Member

ctavan commented Mar 16, 2022

First of all it took me a while to realize that the unflagging of --experimental-json-modules (nodejs/node#41736) has in fact not yet made it to the 16.x line of Node.js.

The problematic piece seems to be the import assertions that were added in 16.14.0.

In any case, the best thing I could come up with was extracting the package.json edge case into a separate test that is only run on node 16.x.

I would like to keep coverage of this edge case as it was a real world problem that we once fixed. At the same time I would like to keep esm tests running on Node.js 14 which also have stable support for them.

ctavan added a commit that referenced this issue Mar 17, 2022
)

While ESM support has been stable in current versions of Node.js 14.x and 16.x, support for importing JSON files is still experimental and evolving.

Since we still want to cover the fact that the package is exporting it's package.json file, this test is now extracted to only run with the updated JSON import syntax which requires import assertions and which was introduced in Node.js 16.14.0.

Fixes #619

Co-authored-by: Robert Kieffer <robert@broofa.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants