René's URL Explorer Experiment


Title: useDefineWithClassFields should use-before-init error when class property initializer refers to parameter property · Issue #50971 · microsoft/TypeScript · GitHub

Open Graph Title: useDefineWithClassFields should use-before-init error when class property initializer refers to parameter property · Issue #50971 · microsoft/TypeScript

X Title: useDefineWithClassFields should use-before-init error when class property initializer refers to parameter property · Issue #50971 · microsoft/TypeScript

Description: Bug Report This bug exists in my project, not only playground, but playground seem to also have bugs, because i can't even seem to reliably reproduce it in the playground – sometimes it does not react on Target change. But right now i ha...

Open Graph Description: Bug Report This bug exists in my project, not only playground, but playground seem to also have bugs, because i can't even seem to reliably reproduce it in the playground – sometimes it does not re...

X Description: Bug Report This bug exists in my project, not only playground, but playground seem to also have bugs, because i can't even seem to reliably reproduce it in the playground – sometimes it does no...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/50971

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"useDefineWithClassFields should use-before-init error when class property initializer refers to parameter property","articleBody":"# Bug Report\r\n\r\nThis bug exists in my project, not only playground, but playground seem to also have bugs, because i can't even seem to reliably reproduce it in the playground – sometimes it does not react on `Target` change. But right now i have an opened playground tab with this bug.\r\n\r\nI will duplicate the MRE code right here as a text.\r\nThis is the source code\r\n\r\n```typescript\r\nclass Helper {\r\n    create(): boolean {\r\n        return true\r\n    }\r\n}\r\n\r\nexport class Broken {\r\n\r\n    constructor(readonly facade: Helper) {\r\n        console.log(this.bug)\r\n    }\r\n    bug = this.facade.create()\r\n\r\n}\r\n\r\nnew Broken(new Helper)\r\n```\r\n\r\nThis is the compiled code with `target: ES2022` and `module: CommonJS`\r\n\r\n```js\r\n\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Broken = void 0;\r\nclass Helper {\r\n    create() {\r\n        return true;\r\n    }\r\n}\r\nclass Broken {\r\n    facade;\r\n    constructor(facade) {\r\n        this.facade = facade;\r\n        console.log(this.bug);\r\n    }\r\n    bug = this.facade.create();\r\n}\r\nexports.Broken = Broken;\r\nnew Broken(new Helper);\r\n```\r\n\r\nIf run this JS – we will get TypeError\r\n\r\n```error\r\nCannot read properties of undefined (reading 'create') \r\n```\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?target=9&module=1&ts=4.8.2&noImplicitUseStrict=true#code/MYGwhgzhAEASCmIAO8BO0DeAoavrFXjABd4AKASgC5oAjAe3pCIDtMc9PDiBXVN4qh7wOuAL5YJWeAA8k9VMXzgo0AEKp6Aa3htso-PRYRBPYMQVlCYACZGQAT2gAzMMFvwaCZGgrtOnMBGEEzwAHQg9ADmZMQAFgCWEGG0PFEUBhKcqVHQALzQ8Ulhru424QREpJRYkrVYLPAA7uqaOixkjS3eKKgUQA)\r\n\r\n\r\nI'm also sharing the playground link, but i assume it could produce the right code for you if you open it first time.\r\nTo reliable reproduce – change `module` to `Node16` and then to `CommonJS`. You should see this result\r\n\r\n\u003cimg width=\"959\" alt=\"Screen Shot 2022-09-27 at 19 54 16\" src=\"https://user-images.githubusercontent.com/9336742/192588709-e036c3cf-6cdc-4aa6-b070-85d267a4862a.png\">\r\n","author":{"url":"https://github.com/dilame","@type":"Person","name":"dilame"},"datePublished":"2022-09-27T16:55:57Z","url":"https://github.com/microsoft/TypeScript/issues/50971"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0a273f1e-eeb4-adc8-0818-9dd602310780
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8552:137C1B:C6C1B9:1043C3B:6AED4DFF
html-safe-nonce059417bef2e0149c8bf6fc286ed7e8da13e53cd45c9c110eff62964d86d436d0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTUyOjEzN0MxQjpDNkMxQjk6MTA0M0MzQjo2QUVENERGRiIsInZpc2l0b3JfaWQiOiI1NjIxMjMyNjQzMDg1MjU4MjM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb4579638e8f8d42e8647829125ff4aa3d009b2d3676ec0172db7b777b171c166
hovercard-subject-tagissue:1388075885
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/50971/issue_layout
twitter:imagehttps://opengraph.githubassets.com/47cd1f3dccc7c8755484bcdaa2e9c09d5ea0c675b087c90ce035c5d411658849/microsoft/TypeScript/issues/50971
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/47cd1f3dccc7c8755484bcdaa2e9c09d5ea0c675b087c90ce035c5d411658849/microsoft/TypeScript/issues/50971
og:image:altBug Report This bug exists in my project, not only playground, but playground seem to also have bugs, because i can't even seem to reliably reproduce it in the playground – sometimes it does not re...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedilame
hostnamegithub.com
expected-hostnamegithub.com
None56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/50971#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F50971
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F50971
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/50971
Reloadhttps://github.com/microsoft/TypeScript/issues/50971
Reloadhttps://github.com/microsoft/TypeScript/issues/50971
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues4.9k (4.9k)https://github.com/microsoft/TypeScript/issues
Pull requests298 (298)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/pulse
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/50971
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/50971
#55028https://github.com/microsoft/TypeScript/pull/55028
useDefineWithClassFields should use-before-init error when class property initializer refers to parameter propertyhttps://github.com/microsoft/TypeScript/issues/50971#top
#55028https://github.com/microsoft/TypeScript/pull/55028
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Help WantedYou can do thishttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Help%20Wanted%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/dilame
Dmitry (dilame)https://github.com/dilame
on Sep 27, 2022https://github.com/microsoft/TypeScript/issues/50971#issue-1388075885
Playground link with relevant codehttps://www.typescriptlang.org/play?target=9&module=1&ts=4.8.2&noImplicitUseStrict=true#code/MYGwhgzhAEASCmIAO8BO0DeAoavrFXjABd4AKASgC5oAjAe3pCIDtMc9PDiBXVN4qh7wOuAL5YJWeAA8k9VMXzgo0AEKp6Aa3htso-PRYRBPYMQVlCYACZGQAT2gAzMMFvwaCZGgrtOnMBGEEzwAHQg9ADmZMQAFgCWEGG0PFEUBhKcqVHQALzQ8Ulhru424QREpJRYkrVYLPAA7uqaOixkjS3eKKgUQA
https://user-images.githubusercontent.com/9336742/192588709-e036c3cf-6cdc-4aa6-b070-85d267a4862a.png
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Sep 27, 2022https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1259810584
#36425https://github.com/microsoft/TypeScript/pull/36425
Nathan Shively-Sanders (@sandersn)https://github.com/sandersn
Dmitry (dilame)https://github.com/dilame
on Sep 27, 2022https://github.com/microsoft/TypeScript/issues/50971#event-7471353083
https://github.com/dilame
Dmitry (dilame)https://github.com/dilame
on Sep 27, 2022https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1259941265
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Sep 27, 2022https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1259989285
https://github.com/fatcerberus
Bruce Pascoe (fatcerberus)https://github.com/fatcerberus
on Sep 27, 2022https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1260029969
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Help WantedYou can do thishttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Help%20Wanted%22
on Sep 27, 2022https://github.com/microsoft/TypeScript/issues/50971#event-7472181744
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Sep 27, 2022https://github.com/microsoft/TypeScript/issues/50971#event-7472182401
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 27, 2022https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1260047959
https://github.com/fatcerberus
Bruce Pascoe (fatcerberus)https://github.com/fatcerberus
on Sep 28, 2022https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1260394699
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 28, 2022https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1261128219
https://github.com/dilame
Dmitry (dilame)https://github.com/dilame
on Sep 28, 2022https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1261293892
https://github.com/rbuckton
Ron Buckton (rbuckton)https://github.com/rbuckton
on Nov 2, 2022https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1301484544
https://github.com/AlCalzone
AlCalzonehttps://github.com/AlCalzone
on Jan 22, 2023https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1399571301
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Feb 7, 2023https://github.com/microsoft/TypeScript/issues/50971#event-8453010494
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Feb 7, 2023https://github.com/microsoft/TypeScript/issues/50971#event-8453011097
Eric Amodio (eamodio)https://github.com/eamodio
on Feb 10, 2023https://github.com/microsoft/TypeScript/issues/50971#event-8492220448
Back to es2022 but turns off `useDefineForClassFields`https://github.com/gitkraken/vscode-gitlens/commit/bc5b85b3e144654722234ebb76a310f29377ac2e
bc5b85bhttps://github.com/gitkraken/vscode-gitlens/commit/bc5b85b3e144654722234ebb76a310f29377ac2e
https://github.com/Azbesciak
Witold Kupś (Azbesciak)https://github.com/Azbesciak
on May 28, 2023https://github.com/microsoft/TypeScript/issues/50971#issuecomment-1566117206
Eric Amodio (eamodio)https://github.com/eamodio
on Jun 12, 2023https://github.com/microsoft/TypeScript/issues/50971#event-9498193953
Avoids use-before-init w/ useDefineForClassFieldshttps://github.com/gitkraken/vscode-gitlens/commit/053266a8980941e997519586138d0742d6e38029
053266ahttps://github.com/gitkraken/vscode-gitlens/commit/053266a8980941e997519586138d0742d6e38029
Ramin Tadayon (ramin-t)https://github.com/ramin-t
on Jun 12, 2023https://github.com/microsoft/TypeScript/issues/50971#event-9499736606
Avoids use-before-init w/ useDefineForClassFieldshttps://github.com/gitkraken/vscode-gitlens/commit/ec9da02ffaebad581d266095b33f24abfbc70b4c
ec9da02https://github.com/gitkraken/vscode-gitlens/commit/ec9da02ffaebad581d266095b33f24abfbc70b4c
Adds ambient context to view nodes & fixes idshttps://github.com/gitkraken/vscode-gitlens/commit/8d6fe132b56eea6f386f3b68b39d53302fa32cf9
8d6fe13https://github.com/gitkraken/vscode-gitlens/commit/8d6fe132b56eea6f386f3b68b39d53302fa32cf9
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#55028https://github.com/microsoft/TypeScript/pull/55028
on Jul 28, 2023https://github.com/microsoft/TypeScript/issues/50971#event-9952908805
microsofthttps://github.com/microsoft
on Oct 22, 2025https://github.com/microsoft/TypeScript/issues/50971#event-20417605894
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/50971
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/50971
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Help WantedYou can do thishttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Help%20Wanted%22
BacklogNo due datehttps://github.com/microsoft/TypeScript/milestone/29
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.