Bundled code is attempting to export before importing (ERROR: _common__WEBPACK_IMPORTED_MODULE_1__ is undefined) #18064
Unanswered
rwilliams3088
asked this question in
Q&A
Replies: 2 comments 7 replies
-
Looks like you have circular modules, can you create reproducible test repo? |
Beta Was this translation helpful? Give feedback.
3 replies
-
Same problem, any solution? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bug report
What is the current behavior?
I have an simple index file that exposes various tsx components and interfaces that looks like so:
Unfortunately, when I attempt to load the page, the output bundle.js file is erroring on this code with the error:
_common__WEBPACK_IMPORTED_MODULE_1__ is undefined
If I dive into the bundled code, it is clear why. The bundle generated by webpack 5 is attempting to export the various modules prior to importing them - and so of course the variables in question are undefined...
If the current behavior is a bug, please provide the steps to reproduce.
My webpack.common.js file is as so:
And my webpack.develoment.js file is like so:
What is the expected behavior?
Webpack should be able to handle
export * from <file>;
statements properly, first importing and then exporting.Other relevant information:
webpack version: ^5.90.0
Node.js version: 16.16.0
Operating System: Ubuntu running in WSL2 on Windows 11
Beta Was this translation helpful? Give feedback.
All reactions