Open maxmilton opened 8 months ago
Did a bit of poking, and found maybe a couple of hints;
this.__check('setup-vm');
this[PropertySymbol.setupVMContext]();
// <-------- from this point on "this" is broken, and next line throws an error (" 'this.__check' is undefined ")
this.__check('classes');
I guess this points to some bug in Bun's implementation of the VM and setting up the context. I'll investigate further when I get a spare moment.
Related to #1415
Describe the bug Attempting to use a
Browser
instance throws aTypeError
when trying to call the browser instance'sclose
method. This only occurs withbun
and not withnodejs
.To Reproduce Steps to reproduce the behavior:
Create a file
test.mjs
:bun ./test.mjs
.Expected behavior Using
await browser.close()
orawait page.close()
should run without throwing.Screenshots
CLI output:
Versions:
Linux 6.7.0-arch3-1 x86_64 unknown
13.2.0
v1.0.23
v21.6.0
Additional context This seems like it could be something to do with how bun transpiles files before running them. Perhaps it's a race condition with the code execution being different from node?
Adding
console.log(Object.getOwnPropertySymbols(frame.window));
before the call to the missing function shows that the symbol is indeed missing:Even though this is bun specific, I feel it's still worth tracking here.