Missing export should be a compile error
See original GitHub issueThis 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](https://cloud.githubusercontent.com/assets/810438/22956070/a23607c8-f317-11e6-9518-5d1b5b64ccf0.png)
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](https://cloud.githubusercontent.com/assets/810438/22956088/c40c51c2-f317-11e6-98d5-dc7731bc9a86.png)
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?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:12
- Comments:15 (12 by maintainers)
Top Results From Across the Web
missing export file for package java/lang
cap file (converted applet file), I get the error message that there is a "missing export file for package java/lang. If I add...
Read more >Typescript: how to fix missing export in embedded definition?
You can use module augmentation to add the missing export. Simply place the following above your import statement:
Read more >Fix export issues in Premiere Pro
Fix issues in Adobe Premiere Pro that cause an "Error while compiling" error message when rendering or exporting.
Read more >Error Loading 'lvanlys.dll': Missing export 'SystemFuction036 ...
Solved: Greetings, I am upgrading from LabVIEW 2012 to LabVIEW2016. This code compiles and functions flawlessly when compiled on 2012 and ...
Read more >NG8003: No directive found with export
Angular can't find a directive with {{ PLACEHOLDER }} export name. This is common with a missing import or a missing exportAs on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Some typescript constructs emit incorrect import/exports (related to the loader impl, not sure if it’s fixed now). So we used a warning. But I guess it fine to add an option upgrading it to an error.
After further investigation after what @insin, it seems
strictModuleExceptionHandling
isn’t what we want (despite some various sources I found). It looks like we need to add a custom hook to parse the webpack warnings.Maybe @sokra could give us some more insight?