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
  • #1559
Closed
Open
Issue created Feb 15, 2017 by Administrator@rootContributor

Missing export should be a compile error

Created by: gaearon

This is only relevant in master which uses Webpack 2.

If I change src/index.js from

import App from './App';

to

import {App} from './App';

I'm getting:

screen shot 2017-02-15 at 00 40 43

The screen is blank (because of the runtime error).

Notice how the real problem is at the very bottom (missing export), yet it looks like the first two are the important ones.

The terminal output is also very restrained (because it is a warning):

screen shot 2017-02-15 at 00 43 03

I wonder what are the reasons for this. I think a missing ES6 export should totally be a compile error because it is so easy to mess it up, and then have weird runtime errors as a result.

I have two questions:

  • Why isn’t in an error by default?
  • Can we make this an error in CRA setup?
Assignee
Assign to
Time tracking