Repository navigation
[NewErrors] 4.3.0-dev.20210412 vs 4.2.4 #43651
Copy link
Copy link
Closed
Labels
InfrastructureIssue relates to TypeScript team infrastructureIssue relates to TypeScript team infrastructure
Description
The following errors were reported by 4.3.0-dev.20210412, but not by 4.2.4
cdr/code-server
9 of 52 projects failed to build with the old tsc
lib/vscode/extensions/html-language-features/server/tsconfig.json
error TS2801: This condition will always return true since this 'Promise<import("/mnt/ts_downloads/code-server/lib/vscode/extensions/node_modules/typescript/lib/typescript").LanguageService>' appears to always be defined.
lib/vscode/extensions/typescript-language-features/tsconfig.json
error TS2801: This condition will always return true since this 'Promise<import("/mnt/ts_downloads/code-server/lib/vscode/extensions/typescript-language-features/src/typescriptService").ServerResponse.Response<protocol.Response>>' appears to always be defined.
lib/vscode/extensions/vscode-custom-editor-tests/tsconfig.json
error TS2339: Property 'document' does not exist on type 'never'.
lib/vscode/src/tsconfig.monaco.json
error TS2344: Type 'Target[K]' does not satisfy the constraint '(...args: any) => any'.error TS2801: This condition will always return true since this 'Promise<void>' appears to always be defined.
ReactiveX/rxjs
7 of 11 projects failed to build with the old tsc
src/tsconfig.cjs.spec.json
error TS2769: No overload matches this call.
src/tsconfig.esm5.rollup.json
error TS2769: No overload matches this call.
typeorm/typeorm
tsconfig.json
error TS2801: This condition will always return true since this 'Promise<any>' appears to always be defined.
microsoft/playwright
2 of 4 projects failed to build with the old tsc
utils/generate_types/test/tsconfig.json
error TS7053: Element implicitly has an 'any' type because expression of type '"pageTarget"' can't be used to index type 'BrowserContext'.error TS2322: Type 'true' is not assignable to type 'false'.
streamich/react-use
tsconfig.json
error TS2345: Argument of type 'Window | ListenerType1' is not assignable to parameter of type 'Window | null'.
react-hook-form/react-hook-form
2 of 4 projects failed to build with the old tsc
tsconfig.jest.json
error TS2739: Type '{}' is missing the following properties from type 'ControllerFieldState': invalid, isTouched, isDirty, isValidating
tsconfig.json
error TS2739: Type '{}' is missing the following properties from type 'ControllerFieldState': invalid, isTouched, isDirty, isValidating
react-navigation/react-navigation
example/tsconfig.json
error TS2578: Unused '@ts-expect-error' directive.
tsconfig.json
error TS2578: Unused '@ts-expect-error' directive.
excalidraw/excalidraw
2 of 4 projects failed to build with the old tsc
tsconfig-types.json
error TS2322: Type '({ id: string; x: number; y: number; strokeColor: string; backgroundColor: string; fillStyle: FillStyle; strokeWidth: number; strokeStyle: StrokeStyle; strokeSharpness: StrokeSharpness; ... 17 more ...; endArrowhead: Arrowhead | null; } & ElementUpdate<...> & { ...; }) | ... 4 more ... | ({ ...; } & ... 1 more ... &...' is not assignable to type 'TElement'.
tsconfig.json
error TS2322: Type '({ id: string; x: number; y: number; strokeColor: string; backgroundColor: string; fillStyle: FillStyle; strokeWidth: number; strokeStyle: StrokeStyle; strokeSharpness: StrokeSharpness; ... 17 more ...; endArrowhead: Arrowhead | null; } & ElementUpdate<...> & { ...; }) | ... 4 more ... | ({ ...; } & ... 1 more ... &...' is not assignable to type 'TElement'.
davidkpiano/xstate
4 of 10 projects failed to build with the old tsc
packages/xstate-inspect/tsconfig.json
error TS2344: Type 'Self[K]' does not satisfy the constraint '(...args: any) => any'.
packages/xstate-svelte/tsconfig.json
error TS2344: Type 'Self[K]' does not satisfy the constraint '(...args: any) => any'.
packages/xstate-test/tsconfig.json
error TS2344: Type 'Self[K]' does not satisfy the constraint '(...args: any) => any'.
packages/xstate-vue/tsconfig.json
error TS2344: Type 'Self[K]' does not satisfy the constraint '(...args: any) => any'.
rome/tools
tsconfig.json
error TS2345: Argument of type 'AnyNode' is not assignable to parameter of type 'Omit<Node, "type">'.error TS2322: Type '{ loc: undefined; type: "HTMLDoctypeTag"; value: string; leadingComments?: string[] | undefined; trailingComments?: string[] | undefined; innerComments?: string[] | undefined; } | { loc: undefined; ... 7 more ...; innerComments?: string[] | undefined; } | ... 300 more ... | { ...; }' is not assignable to type 'T'.error TS2322: Type '{ type: "HTMLDoctypeTag"; value: string; leadingComments?: string[] | undefined; trailingComments?: string[] | undefined; innerComments?: string[] | undefined; loc?: SourceLocation | undefined; } | ... 301 more ... | { ...; }' is not assignable to type 'T'.error TS2322: Type '{ leadingComments: undefined; trailingComments: undefined; innerComments: undefined; type: "HTMLDoctypeTag"; value: string; loc?: SourceLocation | undefined; } | { leadingComments: undefined; ... 7 more ...; loc?: SourceLocation | undefined; } | ... 300 more ... | { ...; }' is not assignable to type 'T'.error TS2322: Type '{ loc: SourceLocation; type: "HTMLDoctypeTag"; value: string; leadingComments?: string[] | undefined; trailingComments?: string[] | undefined; innerComments?: string[] | undefined; } | ... 301 more ... | { ...; }' is not assignable to type 'T & { loc: SourceLocation; }'.error TS2345: Argument of type '{ relativeSegments: PathSegments; explicitDirectory: boolean; type: "absolute-windows-drive"; letter: "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | ... 14 more ... | "Z"; } | ... 5 more ... | { ...; }' is not assignable to parameter of type 'SuperParsed'.error TS2345: Argument of type '{ relativeSegments: string[]; type: "absolute-windows-drive"; letter: "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | ... 5 more ... | "Z"; explicitDirectory: boolean; } | ... 5 more ... | { ...; }' is not assignable to parameter of type 'SuperParsed'.error TS2345: Argument of type '{ explicitDirectory: true; relativeSegments: PathSegments; type: "absolute-windows-drive"; letter: "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | ... 13 more ... | "Z"; } | ... 5 more ... | { ...; }' is not assignable to parameter of type 'SuperParsed'.error TS2345: Argument of type '{ explicitDirectory: false; type: "absolute-windows-drive"; letter: "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | ... 5 more ... | "Z"; relativeSegments: PathSegments; } | ... 5 more ... | { ...; }' is not assignable to parameter of type 'SuperParsed'.
sindresorhus/refined-github
tsconfig.json
error TS2339: Property 'getAttribute' does not exist on type 'Node'.error TS2339: Property 'classList' does not exist on type 'Node'.
jquense/yup
1 of 2 projects failed to build with the old tsc
test/tsconfig.json
error TS2612: Property 'spec' will overwrite the base property in 'BaseSchema<TIn, TContext, TOut>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.
wangeditor-team/wangEditor
cypress/tsconfig.json
error TS2322: Type 'DomElement<DomElementSelector>' is not assignable to type 'DomElement<T>'.error TS2409: Return type of constructor signature must be assignable to the instance type of the class.error TS2322: Type 'HTMLElement[] | ChildNode[]' is not assignable to type 'HTMLElement[]'.
tsconfig.json
error TS2322: Type 'DomElement<DomElementSelector>' is not assignable to type 'DomElement<T>'.error TS2409: Return type of constructor signature must be assignable to the instance type of the class.error TS2322: Type 'HTMLElement[] | ChildNode[]' is not assignable to type 'HTMLElement[]'.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
InfrastructureIssue relates to TypeScript team infrastructureIssue relates to TypeScript team infrastructure
Activity
DanielRosenwasser commentedon Apr 12, 2021
I've done my best to look through the major gotchas and tag the right people.
Anders Hejlsberg (@ahejlsberg) looks like these may be a regressions from on-demand generic narrowing.
Side note:
I think this one is caused by generic narrowing, but is a legit error.
I think this one is improved inference from generic narrowing.
Nathan Shively-Sanders (@sandersn) Orta Therox (@orta) this looks like a regression from #42424
lol
Andrew Branch (@andrewbranch) you already put a fix in for this, right? Or is it still outstanding in some way?
davidkpiano/xstate
4 of 10 projects failed to build with the old tsc
packages/xstate-inspect/tsconfig.json
error TS2344: Type 'Self[K]' does not satisfy the constraint '(...args: any) => any'.Wesley Wigham (@weswigham) something something about substitution types? 😬
The Rome issues all look correct, but I'm surprised they're new. They all relate to spreading a
Tand trying to assign it back to aTwhich is not exactly safe.weswigham commentedon Apr 13, 2021
Daniel Rosenwasser (@DanielRosenwasser) #43599 should handle the one pointed my way.
andrewbranch commentedon Apr 13, 2021
#43593
sandersn commentedon Apr 13, 2021
Orta Therox (@orta) I have really mixed feelings about #42424. On the one hand, a single break isn't that bad, and the workaround is casting
{} as ControllerFieldState-- reasonably obvious. On the other hand, as far as I knowdefinePropertiesis primarily used to add, not overwrite, properties, which means that reusing the input type will always lack the new properties. So I'm not sure the change is actually useful. I'm leaning toward reverting. What is your opinion?orta commentedon Apr 14, 2021
Heh, I'm leaning toward not reverting. But not strongly.
This change does force you to declare to the type system what you are expecting the result of those
Object.defineProperties, prior to this you had an any gap. Admittedly it's a little ambiguous (because you have no guarantee that the thing you set up is the thing you expect) but I think it's a bit tighter and more accurate.sandersn commentedon Apr 14, 2021
Well here's some data that I should have collected before merging:
Object.definePropertiesis rare in TS. The only uses I found in DT+user tests were in some tests (which were almost certainly copied from JS documentation).Object.definePropertiesin some way, like a polyfill or a mock. Any errors are likely to be downstream, but are quite unlikely in JS code.Object.definePropertiestopropsor something -- I didn't analyse any of these aliased uses.The truth is that rarely logging an extra error in JS isn't that bad either. People with
// @ts-checkare used to seeing+ignoring errors, and if they're heavy checkJS users, they'll have already switched to classes or Object.defineProperty since those are supported.This is a big shrug for me, so I think I'll leave it.