Created
January 31, 2019 15:06
-
-
Save ultimatemonty/5e0d676ba02cb67314ce905c8f99272b to your computer and use it in GitHub Desktop.
wtf imports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A, B, G are undefined when trying to reference them | |
import { A, B, G } from 'module-b'; | |
// A, B, G are defined properly | |
import * as Stuff from 'module-b'; | |
const { A, B, G } = Stuff; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// module-a/index.js | |
import A from './a'; | |
import B from './b'; | |
import C from './c'; | |
import D from './d'; | |
import E from './e'; | |
import F from './e'; | |
export { | |
A, | |
B, | |
C, | |
D, | |
E, | |
F | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// module-b/index.js | |
import * as Things from 'module-a'; | |
import G from './g'; | |
const stuff = { | |
...Things, | |
G | |
}; | |
export default stuff; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are
A
,B
,C
, etc defined as of line 10 inmodule-a.js
? Like, if you toss a console.log there, would it log something or undefined?Another thing to try: