Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

typescript + unified = possible? (ESM not been supported by ts-node) #140

Answered by remcohaszing
Ziv-Barber asked this question in Q&A
Discussion options

It's working but I'm getting this warning:

(node:19160) ExperimentalWarning: CommonJS module myCode.ts is loading ES Module node_modules\.pnpm\xast-util-from-xml@4.0.0\node_modules\xast-util-from-xml\index.js using require()
You must be logged in to vote

Replies: 2 comments

Comment options

Hi, that's unrelated to unified and simply your choice of tooling.

From the ts-node readme:

TypeScript execution and REPL for node.js, with source map and native ESM support.

So perhaps you're using an outdated version of ts-node and/or Node.js.

Alternatively, use Bun or tsx.

You must be logged in to vote
0 replies
Comment options

I recommend replacing ts-node with tsx, or using Node.js’ experimental builtin TypeScript runner.

You must be logged in to vote
0 replies
Answer selected by Ziv-Barber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /