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
{{ message }}
Repository navigation
Object.defineProperty doesn't define properties on 'this' #28694
Andriy Kornatskyy (@akornatskyy) I think the source is assumed to be JavaScript in this issue and there is no definite assignment assertion syntax there as far as I can tell.
I am running into this issue in a big code base as well. Could this be looked into again / is that something that could be added to a next roadmap Daniel Rosenwasser (@DanielRosenwasser)?
Activity
xprommer commentedon Jun 11, 2019
Unfortunately it doesn't work in
TSas well,if you run this in
TSplayground (I guess it has the latestTSversion)then it will show only one error message:
"Property 'x' does not exist on type '{}'"but I expected to get different error like
"Property 'toLowercase' does not exist on type 'string'"as was described in https://devblogs.microsoft.com/typescript/announcing-typescript-3-2/#objectdefineproperty-declarations-in-javascripttokland commentedon Oct 29, 2019
Daniel Rosenwasser (@DanielRosenwasser) See #14650
DanielRosenwasser commentedon Oct 29, 2019
Arnau Sanchez Sala (@tokland) This is about JavaScript analysis, not TypeScript.
boneskull commentedon Dec 8, 2020
I'm running in to this one. Anyone know of a workaround?
boneskull commentedon Dec 8, 2020
n/m, workaround for above is something like this:
akornatskyy commentedon Dec 26, 2020
You need to add definite assertion assignment to property 'x: string'.
brainkim commentedon Feb 23, 2021
Andriy Kornatskyy (@akornatskyy) I think the source is assumed to be JavaScript in this issue and there is no definite assignment assertion syntax there as far as I can tell.
BridgeAR commentedon Feb 20, 2025
I am running into this issue in a big code base as well. Could this be looked into again / is that something that could be added to a next roadmap Daniel Rosenwasser (@DanielRosenwasser)?