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

[Bug] Does not works with import attributes #4

Open
bertho-zero opened this issue Nov 13, 2024 · 0 comments
Open

[Bug] Does not works with import attributes #4

bertho-zero opened this issue Nov 13, 2024 · 0 comments

Comments

@bertho-zero
Copy link

This code

import en from "./en.json" with { type: "json" };
import es from "./es.json" with { type: "json" };
import fr from "./fr.json" with { type: "json" };

throws the following error:

import en from "./en.json" with { type: "json" };
                           ^

SyntaxError: Invalid or unexpected token

https://nodejs.org/api/esm.html#import-attributes

The type: 'json' attribute is mandatory when importing JSON modules.

@bertho-zero bertho-zero changed the title [Bug] Does not work import import attributes [Bug] Does not works with import attributes Nov 13, 2024
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

No branches or pull requests

1 participant