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
Linux 5.10.16.3-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
Try to run this script w/ bun:
if(require.main===module){console.log('Running as main')}else{console.log('required by other module')}
What is the expected behavior?
The first statement is logged
What do you see instead?
The second statement is logged
Additional information
This was found when testing compatibility with Nx encapsulated installs, as an experiment to see if bun could run Nx well. So far, this and #401 are two "blockers" that I've found.
The text was updated successfully, but these errors were encountered:
In the current implementation of require, this wouldn't work (CJS modules share the same runtime code as in browsers, which would be one of the things that need to change to support this)
What version of Bun is running?
0.5.6
What platform is your computer?
Linux 5.10.16.3-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
Try to run this script w/ bun:
What is the expected behavior?
The first statement is logged
What do you see instead?
The second statement is logged
Additional information
This was found when testing compatibility with Nx encapsulated installs, as an experiment to see if bun could run Nx well. So far, this and #401 are two "blockers" that I've found.
The text was updated successfully, but these errors were encountered: