swc-project / swc-node

Faster ts-node without typecheck
MIT License
1.78k stars 75 forks source link

TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING] <file> needs an import attribute of type "json" #757

Closed MisterJimson closed 7 months ago

MisterJimson commented 7 months ago

I get the above error when importing a JSON file, even though I do use the import attribute.

Both: import file from './file.json' assert { type: 'json' }; and import file from './file.json' with { type: 'json' };

With is the newer syntax but both should be supported.

yeliex commented 7 months ago

please provide a minimal reproduction