tsx >= 4.15.0 breaks playwright code
Closed this issue · 2 comments
Acknowledgements
- I read the documentation and searched existing issues to avoid duplicates
- I understand this is a bug tracker and anything other than a proven bug will be closed
- I understand this is a free project and relies on community contributions
- I read and understood the Contribution guide
Minimal reproduction URL
https://github.com/RunOrVeith/tsxPlaywrightBug
Problem & expected behavior (under 200 words)
I opened an issue with more information in playwright, but this is probably a tsx/esbuild issue.
Bugs are expected to be fixed by those affected by it
- I'm interested in working on this issue
Compensating engineering work will speed up resolution and support the project
- I'm willing to offer $10 for financial support
Im not able to look into this yet but I took a glance at the reproduction and it didnt look minimal.
Can you remove anything that isnt necessary to reproduce the error?
No, sorry. This is as minimal as I can make it. I was unable to reproduce it with less than that. It's only a few lines, but of course the playwright implementation is more.
Playwright is somehow serializing the code inside addInitScript
and sending it to the browser. But this is a tsx issue because it works with node.
The steps to reproduce are (inside my example repo):
npm i
npx playwright install
npx tsx index.ts
The problem is also resolved with the workaround in evanw/esbuild#2605 (comment), so this might be a duplicate