Skip to content
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

Closed
SwederellNF opened this issue Jan 9, 2025 · 3 comments
Closed

[Bug]: NodeJS 23.6.0 breaks tests using Typescript enums #34263

SwederellNF opened this issue Jan 9, 2025 · 3 comments

Comments

@SwederellNF
Copy link

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

System:
    OS: Windows 11 10.0.26100
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-12850HX
    Memory: 1.46 GB / 4.87 GB
  Binaries:
    Node: 23.6.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.0.0 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.96.2 - C:\Users\Sam\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 5.2.37 - C:\Program Files\Git\usr\bin\bash.EXE
  npmPackages:
    @playwright/test: ^1.49.1 => 1.49.1
@Skn0tt
Copy link
Member

Skn0tt commented Jan 9, 2025

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.

@SwederellNF
Copy link
Author

SwederellNF commented Jan 9, 2025 via email

@Skn0tt
Copy link
Member

Skn0tt commented Jan 9, 2025

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.

@Skn0tt Skn0tt closed this as completed Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants