Using DefinePlugin
to define import
throws an error
#15365
Unanswered
connor4312
asked this question in
Q&A
Replies: 1 comment 12 replies
-
|
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug report
What is the current behavior?
Have a webpack config that includes this in its plugins:
Upon compilation, you'll get an error
If the current behavior is a bug, please provide the steps to reproduce.
See above
What is the expected behavior?
It should not throw an error.
This is due to the recursion check in the
DefinePlugin
...the JavaScript evaluator tries to parse it as
(import)
, which is not valid.Perhaps if the parsing fails, the code should be emitted as-is?
Other relevant information:
webpack version: 5.68.0
Node.js version: v16.13.2
Operating System: Windows 10
Additional tools: N/A
Beta Was this translation helpful? Give feedback.
All reactions