You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should replace import regardless of whether es6 import or require is used.
Actual Behavior
Error: 'virtual:the-answer' is imported as an external by virtual:the-answer?commonjs-proxy, but is already an existing non-external module id.
When using an es6 import everything works fine, but not when using require.
Additionally, when using both at the same time, it compiles but the result is unexpected.
A lib I wanted to import contains a conditional require('crypto') for Node. This require was converted to a non-conditional import by commonjs (I assume). I wanted to get rid of that import by defining a mock module via @rollup/plugin-virtual.
The text was updated successfully, but these errors were encountered:
Hey folks. This issue hasn't received any traction for more than 90 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.
How Do We Reproduce?
https://repl.it/repls/RegalIdioticMicrokernel
Expected Behavior
Should replace import regardless of whether es6
import
orrequire
is used.Actual Behavior
Error: 'virtual:the-answer' is imported as an external by virtual:the-answer?commonjs-proxy, but is already an existing non-external module id.
When using an es6
import
everything works fine, but not when usingrequire
.Additionally, when using both at the same time, it compiles but the result is unexpected.
Potentially related to rollup/rollup-plugin-commonjs#315 and rollup/rollup-plugin-commonjs#327.
Use case
A lib I wanted to import contains a conditional
require('crypto')
for Node. Thisrequire
was converted to a non-conditionalimport
bycommonjs
(I assume). I wanted to get rid of thatimport
by defining a mock module via@rollup/plugin-virtual
.The text was updated successfully, but these errors were encountered: