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
Variable name conflicts when using inlineDynamicImports
#3245
Comments
A repro would be nice as I am really confused as to why there is no definition of log in the inner module. Or is it a global variable? In that case, yes, the outer log should have been deconflicted. |
Ah sorry, |
Repro: https://github.com/philipwalton/rollup-3245-repro Let me know if anything here doesn't make sense. |
Ah, that is helpful, thanks a lot! I'm starting to get an idea of what is going on here. |
The problem is that the namespace object is only deconflicted at the top level but not inside functions that contain dynamic imports that (potentially) reference it. |
Fix at #3256 |
I'm using Rollup and the
inlineDynamicImports
option to bundle my code, and I've run into the following error:When Rollup processes the following code:
It turns it into this:
But notice how in the second line, the function is returning the variable
log
from the outer scope. However, since the function also defines a variable namedlog
in the inner scope, instead of returning the imported module,undefined
gets returned and there's a runtime error.Note: I'm happy to put together a repro if this isn't enough to go off of.
The text was updated successfully, but these errors were encountered: