question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for transpiling imports with `assert {type: "json"}` to use the old native way of node:fs ?

See original GitHub issue

Consider looking at this code: https://deno.land/x/emoji@0.2.1/emoji.ts?source It has assert, which crashes sucrase: image

The 4th line has assert.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alangpiercecommented, Sep 15, 2022

Just released as 3.27.0, let me know if you see issues!

1reaction
renhiyamacommented, Sep 14, 2022

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found