Open mjnrock opened 3 years ago
The same thing is happening to me.
+1 for the same issue. Not related to yarn whatsoever - the same happening with npm.
Come on, it's been more than half a year. Any ideas?
Another plus one from me! thx for the awesome project btw, much love
Was just looking for solution as it gets annoying. it only happens on ESM import error to me.
What's funny is that this lib's developer experience (with the error wall) is still preferable to node's --experimental-modules
What's funny is that this lib's developer experience (with the error wall) is still preferable to node's --experimental-modules
Well.. I've just moved out of esm to --experimental-modules because of that and I am not looking back ;)
@gbkwiatt I'm jealous! I've tried this more than once and it always requires a non-trivial refactor that looks uglier than what I started with.
import
for dependencies and require
to dynamically (and synchronously) load a folder of tests. This turned into a weird promise nightmare with dynamic imports.package.json
a lot, and node wants even more flags for that.
Details
esm-index.js
esm-test.js
Other Details node version:
16.1.0
yarn version:1.22.10
esm version:3.2.25
yarn start
command:node esm-index.js
Upon running
yarn start
, if there is (seemingly so far) any error during the execution, the minified contents ofesm/loader.js
will print to the terminal console. I tried other variations of errors--such asnew ClassTest()
whereClassTest
is undefined, executing a function that does not exist, attempting to import a file that does not exist, typos, etc.-- and all do this.If I don't compile through
esm
, these errors do not produce the contents ofesm/loader.js
. Furthermore, if there are no errors, then the file contents are not produced, either.Example Error Output This is verbatim, with one exception: the actual file path has been truncated.