Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #3237
Closed
Open
Issue created Oct 04, 2017 by Administrator@rootContributor

Support .mjs file extensions

Created by: lencioni

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

  1. node -v: v6.2.2
  2. npm -v:3.10.10
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven’t ejected):
waypoint-test@0.1.0 /Users/joe_lencioni/waypoint-test
└── react-scripts@1.0.14

Then, specify:

  1. Operating system: macOS Sierra
  2. Browser and version (if relevant): Chrome

Steps to Reproduce

(Write your steps here:)

  1. Clone https://github.com/colloquet/waypoint-test.git
  2. npm install
  3. npm start

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."

screen shot 2017-10-04 at 11 33 05 am

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: https://github.com/brigade/react-waypoint/issues/221

Assignee
Assign to
Time tracking