-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import from JSON data URL doesn't work #37647
Labels
esm
Issues and PRs related to the ECMAScript Modules implementation.
Comments
targos
added
the
esm
Issues and PRs related to the ECMAScript Modules implementation.
label
Mar 7, 2021
It's expected that this code doesn't work without the |
@nodejs/modules also #37375 |
aduh95
added a commit
to aduh95/node
that referenced
this issue
Mar 10, 2021
aduh95
added a commit
to aduh95/node
that referenced
this issue
Mar 10, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Darwin Evans-MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64
What steps will reproduce the bug?
To reproduce, run this code in an ECMAScript module:
The code will crash immediately. This code is taken verbatim from node's documentation: https://nodejs.org/docs/latest/api/esm.html#esm_data_imports. The relevant part of the documentation is pasted below for reference:
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
The snippet should print
hello!
and exit. Presumably if you addconsole.log(_)
it should printworld!
as well.What do you see instead?
This error message goes away when the
application/json
import is removed.Additional information
I am logging this because I am trying to understand if this is supposed to work. If not, the documentation probably just needs to be updated. But if it is supposed to work, it would be good to know if the example code needs to be updated. For context I'm the main developer of the esbuild bundler and I'm trying to have it match node's behavior here, so I need to know what the behavior is supposed to be.
The text was updated successfully, but these errors were encountered: