Skip to content

Missing export should be a compile error #1559

Closed
@gaearon

Description

@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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions