-
Notifications
You must be signed in to change notification settings - Fork 147
import value is 'undefined' when using esm in an application that uses packages with esm #325
Comments
Hi @CacheControl! I can't seem to reproduce this using Node v8.10.0 (npm v5.7.1). Update: I tested this on Mac OS and Windows 10 with Node v8.10.0 on both without issue It looks like your example isn't really using |
@jdalton I'm on OS X El Capitan (10.11.6)
I committed that repo as-is immediately after taking the screencap |
Ah nice, I got it on my second run with Update: This is interesting... the instrumented files by Update:
Update: Ok, it's the data map in the Update: Ok, it's not merging old state with new state correctly. Update: Fixed it! Now to make super sure! Update: Besides fixing the issue this avoids parsing files known to have no transformations and makes the cache less chatty too 😋 Update: v3.0.8 is released 🎉 |
This scenario caught 2 issues. |
@jdalton heck yes I'm up for it! |
This is a very weird bug I encountered this week with
esm
. I had a package that was on esm3.0.6
, which was installed in an application using esm (same 3.0.6 version). When running tests in my application, theimport
value of the package consistently resulted inundefined
whenever run withnyc + mocha
.Thinking it was a special combination of mocha/nyc/esm, I created a repo to reproduce, and was able to get the behavior to happen with only mocha (no nyc), however this time it was seemingly random and would resolve itself after running the tests a few more times.
The repo is here, and includes a screen capture of the behavior and installation instructions. It only fails for me every so often, and randomly. You'll see in the screencap I edited package.json, because at the time I observed the problem goes away after changing a local file (I thought perhaps it was some kind of caching bug), however later on I realized that running the tests over and over again would eventually result in success. It may be my imagination, but the problem seems to occur more frequently when run through mocha + nyc, though again I can make it happen with mocha alone.
edit: I've reproduced this with both a standard npm install of the esm package, and when npm linking it.
Node version: v8.9.4
npm version: 5.7.1
The text was updated successfully, but these errors were encountered: