Support for transpiling imports with `assert {type: "json"}` to use the old native way of node:fs ?
See original GitHub issueConsider looking at this code: https://deno.land/x/emoji@0.2.1/emoji.ts?source
It has assert
, which crashes sucrase:
The 4th line has assert
.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Module "file:///path/to/data.json" needs an import assertion of ...
I then run tsc --emitDeclarationsOnly and I get Import assertions are not allowed on statements that transpile to commonjs 'require' calls. At ...
Read more >Import assertions are only supported when the ... - GitHub
In my code, I import a .json file. When I tried to use the resulting ESM library in node 18, though, I get:...
Read more >Modules: Packages | Node.js v19.3.0 Documentation
It can load JSON modules, but an import assertion is required. It accepts only .js , .mjs , and .cjs extensions for JavaScript...
Read more >Using ES Modules (ESM) in Node.js: A Practical Guide (Part 1)
The ESM this post is talking about is native ESM that is supported by Node.js without transpiling. While syntactically it is the same, ......
Read more >babel/preset-env
babel/preset-env` is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just released as 3.27.0, let me know if you see issues!
Oh i didn’t knew it was supported in nodejs v16! Yea then we can continue with what you said above! (I didn’t test a json import but I remember doing it last year) looking forward for the fix since a lot of deno modules use that and I need a way to get them too!