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
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
Bug Report
π Search Terms
resolveJsonModule typescript 4.5 node node12 nodenext
π Version & Regression Information
4.5 +
β― Playground Link
Playground link with relevant code
π» Code
set resolveJsonModule true and moduleResolution node12 or nodenext in the tsconfig.json
π Actual behavior
Errors
π Expected behavior
should work with
node12
andnodenext
alsoThe text was updated successfully, but these errors were encountered: