standard-things / esm

Tomorrow's ECMAScript modules today!
Other
5.26k stars 146 forks source link

TypeError: Cannot read property 'next' of undefined #739

Closed ericelliott closed 5 years ago

ericelliott commented 5 years ago

I'm getting a build error on Travis from ESM with the following error:

file:///home/travis/build/ericelliott/autodux/node_modules/riteway/node_modules/esm/esm.js:1
TypeError: Cannot read property 'next' of undefined
    at file:///home/travis/build/ericelliott/autodux/node_modules/riteway/node_modules/esm/esm.js:1
    at file:///home/travis/build/ericelliott/autodux/node_modules/riteway/node_modules/esm/esm.js:1
    at Object.apply (file:///home/travis/build/ericelliott/autodux/node_modules/riteway/node_modules/esm/esm.js:1)
    at file:///home/travis/build/ericelliott/autodux/node_modules/nyc/node_modules/append-transform/index.js:62:4
    at Object.<anonymous> (file:///home/travis/build/ericelliott/autodux/node_modules/nyc/node_modules/append-transform/index.js:62:4)
    at Object.xh (file:///home/travis/build/ericelliott/autodux/node_modules/riteway/node_modules/esm/esm.js:1)

I can't reproduce this on my local machine, so debugging it is tricky.

Of note though is that the error is coming from esm in RITEway, and I'm also using esm in autodux, which depends on RITEway.

Am I doing this wrong?

jdalton commented 5 years ago

So the last couple of updates to esm allowed it to work with the nyc cache without blowing it away (as it used to do). I'm wondering if you update your esm version across the deps if the issue is resolve. If you do that and the issue isn't it could point to a gap in the nyc cache fix.

dnalborczyk commented 5 years ago

I can't reproduce this on my local machine, so debugging it is tricky.

I can repro when running npm run test-coverage-ci, node v11.11.0, macOS

[although it also passes once in a while when run multiple times in a row.]

jdalton commented 5 years ago

I can repro it too, even on the same esm version. Digging in.

Update:

I've isolated the problem.

Update:

Fixed it locally.

Update:

esm v3.2.14 is released 🎉