typescript-transform-paths icon indicating copy to clipboard operation
typescript-transform-paths copied to clipboard

[Bug] Import assertion is not supported

Open vladimiry opened this issue 2 years ago • 2 comments

The import assertion thing was added in TS by https://github.com/microsoft/TypeScript/commit/ec114b8931bf1ad15fd017ecbacf09e099338820

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#import-assertions

Currently, the import assertion is being lost (since node.assertClause is not taken into the consideration by typescript-transform-paths) and so you get the ERR_IMPORT_ASSERTION_TYPE_MISSING-like error if node >= 16.14 is used (previous versions don't force import assertion, like for importing json files with --experimental-json-modules arg).

vladimiry avatar May 16 '22 15:05 vladimiry

Thanks for the report, @vladimiry ! I apologize for the delay. I've been pretty tied up this year.

I will add support and update this thread when it's ready!

nonara avatar Aug 10 '22 01:08 nonara

A patch like this https://github.com/vladimiry/ElectronMail/blob/master/patches/typescript-transform-paths%403.3.1.patch resolves the issue for me (not sure if it handles all the cases).

vladimiry avatar Aug 10 '22 08:08 vladimiry

Added in v3.4.0. Let me know if you still have any issues.

nonara avatar Oct 20 '22 21:10 nonara