question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing export should be a compile error

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:12
  • Comments:15 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
sokracommented, Feb 20, 2017

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.

2reactions
Timercommented, Feb 15, 2017

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found