-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Support .mjs file extensions #3237
Comments
Considering Node landed I welcome a PR to add support for the extension. 😄 |
Note, even though the specification states:
I'd like to fallback last to |
I'm still seeing an issue with destructuring Note that when I switch the extension from |
Is this a bug report?
Yes?
Can you also reproduce the problem with npm 4.x?
Yes
Which terms did you search for in User Guide?
mjs, extension, static, media
Environment
node -v
: v6.2.2npm -v
:3.10.10yarn --version
(if you use Yarn):npm ls react-scripts
(if you haven’t ejected):Then, specify:
Steps to Reproduce
(Write your steps here:)
Expected Behavior
Page loads without errors.
Actual Behavior
Page shows error: "InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/index.73a4b08a.mjs') is not a valid name."
Reproducible Demo
See repro instructions above
I believe this is happening because webpack has been configured to treat files with filenames ending in
.mjs
as static files, so when you import one instead of returning a reference to the export, it will output the contents in static/media and return the path to that file as a string.Originally reported: civiccc/react-waypoint#221
The text was updated successfully, but these errors were encountered: