-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Bun.build
makes reference to undefined variable tagSymbol
#11032
Comments
There are two unrelated bugs at play here. One is importing a non-existent symbol from a commonjs module, and the other has to do with not detecting exports correctly in a commonjs source file for branches. Here's a reduced test case for the first bug:
Having Let's do a
Nope. But it's curious that the runtime.js contents appears 4 times in the bun binary - not sure why that's the case. Let's edit the bun binary as follows:
Now let's rerun the test case with the newly edited bun binary:
If the commonjs symbol import is not found then Now let's look at reduced test cases for the second bug.
The export block emitted is invalid. Let's change the test case slightly to introduce braces in the
That works fine. Now let's remove the
That also works. A bug fix might investigate one of these workarounds. |
What version of Bun is running?
1.1.7+b0b7db5c0
What platform is your computer?
Darwin 23.1.0 arm64 arm
What steps can reproduce the bug?
What is the expected behavior?
Valid build output
What do you see instead?
Invalid build output, that makes reference to undefined variable
tagSymbol
:Additional information
I encountered this error while trying to create a minimal reproduction for another error (not yet reproduced), where the following build output was produced during a build of
react-dom
(invalid because it makes reference toexports
without definining it):The text was updated successfully, but these errors were encountered: