-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[Bug]: NodeJS 23.6.0 breaks tests using Typescript enums #34263
Comments
This seems like more of a Node.js issue to me. Could you elaborate on why you think Playwright is at fault here? As a workaround, either remove the enum or use |
Taking out the enums isn’t really feasible. Will try the experimental transform flag and see if that works properly for what I’m doing.
The point of the post was more about bringing it to the Playwright teams' attention that this issue is happening, rather than putting the blame on Playwright itself. I’m working on a GH issue for NodeJS as well.
|
Thanks for bringing it to our attention. It's not an issue with Playwright and we can't do anything about it, so i'll close the issue. |
I ran into the same problem. After removing all enums, Playwright completely breaks with a node "$basedir/../playwright/cli.js" "$@" For Node.js 23+, this needs to be changed to: node --no-experimental-strip-types "$basedir/../playwright/cli.js" "$@" Without this change, the tests won’t start. Since Playwright has its own mechanism for running TypeScript files, Node.js interferes with its type-stripping feature. Reference: Node.js TypeScript API Temporary SolutionUntil this is fixed, in "scripts": {
"test": "node --no-experimental-strip-types node_modules/playwright/cli.js test"
} Error
|
Version
1.49.1
Steps to reproduce
Clone repo: https://github.com/SwederellNF/enum-test
Run "npm install"
Run "npx playwright test"
Syntax error shown: "x Typescript enum is not supported in strip-only mode"
Expected behavior
It should run 1 example test.
Actual behavior
The following error is output to the 'Test Results' panel:
SyntaxError: x TypeScript enum is not supported in strip-only mode
,-[1:1]
1 | ,-> export enum TAGS {
2 | | test = "@testtag"
3 |
-> }
----Additional context
If you uninstall NodeJS 23.6.0 and install the current LTS version (22.13.0) version.
In version 23.6.0 the previously experimental flag was changed to default as below (from the release notes):
Unflagging --experimental-strip-types
This release enables the flag --experimental-strip-types by default.
Node.js will be able to execute TypeScript files without additional configuration:
node file.ts
There are some limitations in the supported syntax documented at https://nodejs.org/api/typescript.html#type-stripping
This feature is experimental and is subject to change.
Contributed by Marco Ippolito in nodejs/node#56350
Environment
The text was updated successfully, but these errors were encountered: