Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing namespace member warnings are the wrong way round #1045

Closed
Rich-Harris opened this issue Oct 12, 2016 · 0 comments · Fixed by #1046
Closed

Missing namespace member warnings are the wrong way round #1045

Rich-Harris opened this issue Oct 12, 2016 · 0 comments · Fixed by #1046
Assignees

Comments

@Rich-Harris
Copy link
Contributor

A situation like this...

// main.js
import * as foo from './foo.js';
console.log( foo.bar );

// foo.js
export const notBar = 42;

...results in a bundle like this...

const notBar = 42;

var foo = Object.freeze({
  notBar: notBar
});

console.log( foo.bar );

...and a warning like this:

Export 'bar' is not defined by 'main.js'

The warning is wrong – it's foo.js that should define bar, not main.js. If it was correct, the message would still be somewhat cryptic.

Also, there's really no need to reify the foo namespace in cases like this.

@Rich-Harris Rich-Harris self-assigned this Oct 12, 2016
Rich-Harris added a commit that referenced this issue Dec 12, 2016
fix missing namespace member warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant