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.

Hi, in my package.json I have two scripts, my start script is working, but dev using node-dev isn’t

{
    "scripts": {
        "dev": "node-dev --experimental-specifier-resolution=node --loader ts-node/esm/transpile-only src/index.ts",
        "start": "node --experimental-specifier-resolution=node --loader ts-node/esm/transpile-only src/index.ts",
    },
   //...
}

I’m trying to work with ESM, because I need top level await

This is the error:

[ERROR] 19:34:14 RangeError: Unknown module format: null for URL file:///path_to_project/src/index.ts

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:8
  • Comments:5

github_iconTop GitHub Comments

4reactions
privatenumbercommented, Aug 18, 2022

Recommending using tsx watch here.

It’s like node-dev in that also only watches files that are imported, but it also supports native ESM.

1reaction
EliseyMartynovcommented, Oct 6, 2022

@privatenumber thank you for mentioning this package! That really helped

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why ESM fails: 7 sure-fire ways to kill your project - Micro Focus
Here are the key issues experts have seen derail ESM projects in ... and making too many assumptions, people will struggle to automate...
Read more >
ESM debut may struggle to repeat history | Reuters
With the ESM's improved structure, the joint EFSF/ESM management is confident that even more investors will be able to buy the permanent replacement....
Read more >
Home | ESM
We will provide tailored stress elimination solutions to create awareness, monitor stress levels, and combat short and long term negative impacts of stress ......
Read more >
This post saved me from my 2 week struggle with ESM. THANK YOU ...
This post saved me from my 2 week struggle with ESM. THANK YOU! It's a great hotfix. ... DEV Community ‍ ...
Read more >
History | European Stability Mechanism
Read online version of the ESM history book “Safeguarding the Euro in Times ... of the ESM" The context Euro zone debt crisis...
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