Esm: Error: Cannot find module ... with chrome dev tools and ndb

Created on 6 Feb 2019  路  5Comments  路  Source: standard-things/esm

I noticed this some time ago, but didn't follow up on it. not sure if my expectations are correct and the following should work:

repro:

// index.js
console.log('test')
node index.js  # works
node -r esm index.js # works

ndb -r esm . # works
ndb -r esm ./index.js # works
ndb -r esm index.js # Error: Cannot find module 'index.js'

# same with chrome dev tools (used by `ndb` I believe)
node --inspect-brk index.js # works
node -r esm --inspect-brk index.js  # Error: Cannot find module 'index.js'

tested with latest patch of v3.0.x, 3.1.x, and v3.2.x

question

All 5 comments

Hi @dnalborczyk!

This looks like a bug in Node 11.4.0+. It happens regardless of what the preload script is.

I've reported it and will ping back when it's resolved.

thank you!

Good news!

I narrowed the problem Node commit down and the committer has been notified for review.

oh, nice! awesome! thank you @jdalton !

More news. It looks like it's going to be fixed for v12.0 for sure. I'm still nudging to see if a v11.x fix is possible. Node v11 active support ends in April and is EOL by July (odd number releases are shorter since they aren't LTS).

Update:

Patch landed for Node v12.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OmgImAlexis picture OmgImAlexis  路  3Comments

dnalborczyk picture dnalborczyk  路  3Comments

Pokute picture Pokute  路  3Comments

kherock picture kherock  路  3Comments

ericelliott picture ericelliott  路  3Comments