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:
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):
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?