Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ESM support in Node is quite recent, which can cause some hiccups sometimes.
Here, this was due to bad local imports which resulted in the need to use an experimental specifier.
The issue is that specifier is not actively developed at this time: nodejs/node#41087 (comment)
I reevaluated the need for it, and it ain't cool for users to have to specify this kind of thing, it should just work ™️.
So, I read back what I would call "The Bible of howto ESM" and followed the advice listed in here: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
Mainly, what changed:
An alpha release has been made with this code, it can be found on version 0.1.1-alpha1
For the users: just call
node ./yourScriptThatDependsOnThisPackage.mjs
, no flags whatsoever, and it will work.Footnotes
https://nodejs.org/api/esm.html#import-specifiers ↩