You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Typescript 4.5 resolveJsonModule should also work with node12 and nodenext module and resolveTypesย #46362
JSON imports in esm mode imports at least are still experimental and need a flag, and there's a big kerfuffle over on the node repo as to weather they should require an assert { type: "json" } on the import (see conversations on nodejs/node#37375 and nodejs/node#40250 ). We can allow it for cjs mode imports pretty painlessly, but for esm imports it's still experimental, unfortunately (and not having any named imports is unfortunately going to be a big change from current behavior, too). So the fix for this might not take the shape you're expecting.
also there are .cjs files possible in case of node12 and nodenext where it should be painless to allow it so allow it in general is fine. As there are also none node environments that are working with .mjs and cjs it is fine to enable it
Activity
weswigham commentedon Oct 19, 2021
JSON imports in esm mode imports at least are still experimental and need a flag, and there's a big kerfuffle over on the
noderepo as to weather they should require anassert { type: "json" }on the import (see conversations on nodejs/node#37375 and nodejs/node#40250 ). We can allow it for cjs mode imports pretty painlessly, but for esm imports it's still experimental, unfortunately (and not having any named imports is unfortunately going to be a big change from current behavior, too). So the fix for this might not take the shape you're expecting.frank-dspeed commentedon Oct 20, 2021
Wesley Wigham (@weswigham) we use it only for typechecking inside our project https://github.com/rollup/rollup/blob/master/rollup.config.ts
we extract the version fild of the package.json.
also there are .cjs files possible in case of node12 and nodenext where it should be painless to allow it so allow it in general is fine. As there are also none node environments that are working with .mjs and cjs it is fine to enable it