Skip to content

[Bug] Does not works with import attributes #4

@bertho-zero

Description

@bertho-zero

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions