"useDefineForClassFields" compiles invalid code which fails at runtime. #57543
Labels
Duplicate
An existing issue was already created
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
🔎 Search Terms
"useDefineForClassFields" "vite" "esbuild" "invalid initialization order" "property initializers are executed before constructor initializers"
🕗 Version & Regression Information
Version 5.3.3, tried 5.4-beta with the same bug.
⏯ Playground Link
https://www.typescriptlang.org/play?useDefineForClassFields=true&target=99&resolvePackageJsonImports=false&ts=5.3.3#code/LAKAxgNghgzjAEBBeBvU95gPYDsYBcAnAVzHy0IAoAHQgSwDcp8BTeKALlSgFstic+LjmI8ARi0IBfAJSp0GTLhhYILAHQQsAc0r4AFnRjqwMgNwKpoBdpb54YynLQhF8QneKEcGA0fVQAXwC+Bau8FYgCmDCohKE8AC88H7GYvAAVPAAzGGRoDgsAO5IlCi8-IJc2bJmQA
💻 Code
🙁 Actual behavior
When I run the code, it fails with
🙂 Expected behavior
Code shouldn't compile
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: