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
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:
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 --experimental-transform-types.
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.
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: