microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.91k stars 12.47k forks source link

[NewErrors] 5.4.0-dev.20240121 vs 5.3.3 #57117

Closed typescript-bot closed 9 months ago

typescript-bot commented 9 months ago

The following errors were reported by 5.4.0-dev.20240121, but not by 5.3.3 Pipeline that generated this bug Logs for the pipeline run File that generated the pipeline

This run considered 200 popular TS repos from GH (after skipping the top 0).

Successfully analyzed 115 of 200 visited repos | Outcome | Count | |---------|-------| | Detected interesting changes | 12 | | Detected no interesting changes | 103 | | Git clone failed | 3 | | Package install failed | 35 | | Project-graph error in old TS | 5 | | Too many errors in old TS | 38 | | Unknown failure | 4 |

Investigation Status

Repo Errors Outcome
BuilderIO/qwik 2 #56004, #56598
chakra-ui/chakra-ui 1 Not a regression
drizzle-team/drizzle-orm 16 #56004
heyxyz/hey 1 Intentional isolatedModules correctness improvement
pixijs/pixijs 2 Routine DOM update #57027
prisma/prisma 10 Intentional isolatedModules correctness improvement
pubkey/rxdb 3 #54477, only showed up in editor for some reason
quilljs/quill 3 Unused ts-expect-error due to #56908, Intentional isolatedModules correctness improvement
react-hook-form/react-hook-form 1 #56004
reduxjs/react-redux 2 #56515
refined-github/refined-github 5 #56004
vuejs/core 3 #55015, #56004
typescript-bot commented 9 months ago

BuilderIO/qwik

**10 of 11 projects failed to build with the old tsc and were ignored** ### [tsconfig.json](https://github.com/BuilderIO/qwik/blob/44c15a8fb13d39a147ff7f2e92f31bd66b976a09/tsconfig.json) - `error TS2604: JSX element type 'Cmp' does not have any construct or call signatures.` - [packages\/qwik\/src\/core\/render\/jsx\/types\/jsx-types.unit.tsx\#L201](https://github.com/BuilderIO/qwik/blob/44c15a8fb13d39a147ff7f2e92f31bd66b976a09/packages/qwik/src/core/render/jsx/types/jsx-types.unit.tsx#L201) - `error TS2345: Argument of type 'EventQRL' is not assignable to parameter of type 'EventQRL<"copy" | "progress" | "reset" | "scroll" | "resize" | "drag" | "fullscreenchange" | "fullscreenerror" | "abort" | "animationcancel" | "animationend" | "animationiteration" | ... 112 more ... | "qvisible">'.` - [packages\/qwik\/src\/core\/use\/use-on.ts\#L31](https://github.com/BuilderIO/qwik/blob/44c15a8fb13d39a147ff7f2e92f31bd66b976a09/packages/qwik/src/core/use/use-on.ts#L31) - [packages\/qwik\/src\/core\/use\/use-on.ts\#L64](https://github.com/BuilderIO/qwik/blob/44c15a8fb13d39a147ff7f2e92f31bd66b976a09/packages/qwik/src/core/use/use-on.ts#L64) - [packages\/qwik\/src\/core\/use\/use-on.ts\#L98](https://github.com/BuilderIO/qwik/blob/44c15a8fb13d39a147ff7f2e92f31bd66b976a09/packages/qwik/src/core/use/use-on.ts#L98)
typescript-bot commented 9 months ago

chakra-ui/chakra-ui

**4 of 28 projects failed to build with the old tsc and were ignored** ### [packages\/components\/tsconfig.build.json](https://github.com/chakra-ui/chakra-ui/blob/7a06603bd61e06e0591bf68d6dd50daad2c336af/packages/components/tsconfig.build.json) - `error TS5056: Cannot write file '/mnt/ts_downloads/chakra-ui/packages/components/dist/types/menu/menu.stories.d.ts' because it would be overwritten by multiple input files.` - Project Scope
typescript-bot commented 9 months ago

drizzle-team/drizzle-orm

**18 of 25 projects failed to build with the old tsc and were ignored** ### [drizzle-orm\/tests\/tsconfig.json](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/tests/tsconfig.json) - `error TS2345: Argument of type 'SQLiteD1Session>' is not assignable to parameter of type 'SQLiteSession<"async", unknown, Record, TablesRelationalConfig>'.` - [drizzle-orm\/src\/d1\/migrator.ts\#L10](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/d1/migrator.ts#L10) - `error TS2345: Argument of type 'LibSQLSession>' is not assignable to parameter of type 'SQLiteSession<"async", unknown, Record, TablesRelationalConfig>'.` - [drizzle-orm\/src\/libsql\/migrator.ts\#L10](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/libsql/migrator.ts#L10) - `error TS2536: Type 'keyof TSchema' cannot be used to index type 'TFullSchema extends Record ? DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?"> : { [K in keyof TSchema]: RelationalQueryBuilder; }'.` - [drizzle-orm\/src\/sqlite-core\/db.ts\#L62](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/sqlite-core/db.ts#L62) - `error TS2536: Type 'keyof TSchema' cannot be used to index type 'this["query"]'.` - [drizzle-orm\/src\/sqlite-core\/db.ts\#L71](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/sqlite-core/db.ts#L71) ### [drizzle-orm\/tsconfig.dts.json](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/tsconfig.dts.json) - `error TS2345: Argument of type 'SQLiteD1Session>' is not assignable to parameter of type 'SQLiteSession<"async", unknown, Record, TablesRelationalConfig>'.` - [drizzle-orm\/src\/d1\/migrator.ts\#L10](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/d1/migrator.ts#L10) - `error TS2345: Argument of type 'LibSQLSession>' is not assignable to parameter of type 'SQLiteSession<"async", unknown, Record, TablesRelationalConfig>'.` - [drizzle-orm\/src\/libsql\/migrator.ts\#L10](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/libsql/migrator.ts#L10) - `error TS2536: Type 'keyof TSchema' cannot be used to index type 'TFullSchema extends Record ? DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?"> : { [K in keyof TSchema]: RelationalQueryBuilder; }'.` - [drizzle-orm\/src\/sqlite-core\/db.ts\#L62](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/sqlite-core/db.ts#L62) - `error TS2536: Type 'keyof TSchema' cannot be used to index type 'this["query"]'.` - [drizzle-orm\/src\/sqlite-core\/db.ts\#L71](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/sqlite-core/db.ts#L71) ### [drizzle-orm\/tsconfig.json](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/tsconfig.json) - `error TS2345: Argument of type 'SQLiteD1Session>' is not assignable to parameter of type 'SQLiteSession<"async", unknown, Record, TablesRelationalConfig>'.` - [drizzle-orm\/src\/d1\/migrator.ts\#L10](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/d1/migrator.ts#L10) - `error TS2345: Argument of type 'LibSQLSession>' is not assignable to parameter of type 'SQLiteSession<"async", unknown, Record, TablesRelationalConfig>'.` - [drizzle-orm\/src\/libsql\/migrator.ts\#L10](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/libsql/migrator.ts#L10) - `error TS2536: Type 'keyof TSchema' cannot be used to index type 'TFullSchema extends Record ? DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?"> : { [K in keyof TSchema]: RelationalQueryBuilder; }'.` - [drizzle-orm\/src\/sqlite-core\/db.ts\#L62](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/sqlite-core/db.ts#L62) - `error TS2536: Type 'keyof TSchema' cannot be used to index type 'this["query"]'.` - [drizzle-orm\/src\/sqlite-core\/db.ts\#L71](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/sqlite-core/db.ts#L71) ### [drizzle-orm\/type-tests\/tsconfig.json](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/type-tests/tsconfig.json) - `error TS2345: Argument of type 'SQLiteD1Session>' is not assignable to parameter of type 'SQLiteSession<"async", unknown, Record, TablesRelationalConfig>'.` - [drizzle-orm\/src\/d1\/migrator.ts\#L10](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/d1/migrator.ts#L10) - `error TS2345: Argument of type 'LibSQLSession>' is not assignable to parameter of type 'SQLiteSession<"async", unknown, Record, TablesRelationalConfig>'.` - [drizzle-orm\/src\/libsql\/migrator.ts\#L10](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/libsql/migrator.ts#L10) - `error TS2536: Type 'keyof TSchema' cannot be used to index type 'TFullSchema extends Record ? DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?"> : { [K in keyof TSchema]: RelationalQueryBuilder; }'.` - [drizzle-orm\/src\/sqlite-core\/db.ts\#L62](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/sqlite-core/db.ts#L62) - `error TS2536: Type 'keyof TSchema' cannot be used to index type 'this["query"]'.` - [drizzle-orm\/src\/sqlite-core\/db.ts\#L71](https://github.com/drizzle-team/drizzle-orm/blob/d20bd54cfbc7a8ead2b14eb24af7b73c752b80e2/drizzle-orm/src/sqlite-core/db.ts#L71)
typescript-bot commented 9 months ago

heyxyz/hey

**1 of 12 projects failed to build with the old tsc and were ignored** ### [apps\/web\/tsconfig.json](https://github.com/heyxyz/hey/blob/e4e9882198dd0184a9741ceef15e188dda7ebdf1/apps/web/tsconfig.json) - `error TS2865: Import 'PublicationStats' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [apps\/web\/src\/components\/Publication\/PublicationStats.tsx\#L13](https://github.com/heyxyz/hey/blob/e4e9882198dd0184a9741ceef15e188dda7ebdf1/apps/web/src/components/Publication/PublicationStats.tsx#L13)
typescript-bot commented 9 months ago

pixijs/pixijs

### [tsconfig.json](https://github.com/pixijs/pixijs/blob/5ae1d3b57e6e4a72f3b16f1836bd68eb37f75b9f/tsconfig.json) - `error TS2430: Interface 'ICanvasRenderingContext2D' incorrectly extends interface 'CanvasTextDrawingStyles'.` - [packages\/settings\/src\/ICanvasRenderingContext2D.ts\#L7](https://github.com/pixijs/pixijs/blob/5ae1d3b57e6e4a72f3b16f1836bd68eb37f75b9f/packages/settings/src/ICanvasRenderingContext2D.ts#L7) ### [tsconfig.types.json](https://github.com/pixijs/pixijs/blob/5ae1d3b57e6e4a72f3b16f1836bd68eb37f75b9f/tsconfig.types.json) - `error TS2430: Interface 'ICanvasRenderingContext2D' incorrectly extends interface 'CanvasTextDrawingStyles'.` - [packages\/settings\/src\/ICanvasRenderingContext2D.ts\#L7](https://github.com/pixijs/pixijs/blob/5ae1d3b57e6e4a72f3b16f1836bd68eb37f75b9f/packages/settings/src/ICanvasRenderingContext2D.ts#L7)
typescript-bot commented 9 months ago

prisma/prisma

**75 of 106 projects failed to build with the old tsc and were ignored** ### [packages\/debug\/tsconfig.build.json](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/tsconfig.build.json) - `error TS2865: Import 'Debug' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [packages\/debug\/src\/index.ts\#L3](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/src/index.ts#L3) ### [packages\/debug\/tsconfig.json](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/tsconfig.json) - `error TS2865: Import 'Debug' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [packages\/debug\/src\/index.ts\#L3](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/src/index.ts#L3) ### [packages\/get-platform\/tsconfig.json](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/get-platform/tsconfig.json) - `error TS2865: Import 'Debug' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [packages\/debug\/src\/index.ts\#L3](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/src/index.ts#L3) ### [packages\/engines\/tsconfig.build.json](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/engines/tsconfig.build.json) - `error TS2865: Import 'Debug' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [packages\/debug\/src\/index.ts\#L3](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/src/index.ts#L3) ### [packages\/engines\/tsconfig.json](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/engines/tsconfig.json) - `error TS2865: Import 'Debug' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [packages\/debug\/src\/index.ts\#L3](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/src/index.ts#L3) ### [packages\/generator-helper\/tsconfig.json](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/generator-helper/tsconfig.json) - `error TS2865: Import 'Debug' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [packages\/debug\/src\/index.ts\#L3](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/src/index.ts#L3) ### [packages\/internals\/tsconfig.json](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/internals/tsconfig.json) - `error TS2865: Import 'Debug' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [packages\/debug\/src\/index.ts\#L3](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/src/index.ts#L3) ### [packages\/instrumentation\/tsconfig.json](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/instrumentation/tsconfig.json) - `error TS2865: Import 'Debug' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [packages\/debug\/src\/index.ts\#L3](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/src/index.ts#L3) ### [packages\/client\/tsconfig.build.json](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/client/tsconfig.build.json) - `error TS2865: Import 'Debug' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [packages\/debug\/src\/index.ts\#L3](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/src/index.ts#L3) ### [packages\/cli\/tsconfig.build.json](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/cli/tsconfig.build.json) - `error TS2865: Import 'Debug' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.` - [packages\/debug\/src\/index.ts\#L3](https://github.com/prisma/prisma/blob/693260761eecb61faed7f2229e63676be7b2453f/packages/debug/src/index.ts#L3)
typescript-bot commented 9 months ago

pubkey/rxdb

**9 of 11 projects failed to build with the old tsc and were ignored** ### [tsconfig.json](https://github.com/pubkey/rxdb/blob/206b5a6f1bbd2a09e9942ef4c615d02cbed8e19b/tsconfig.json) - `error TS2339: Property 'previousDocumentData' does not exist on type 'EventBulk, any>'.` - [test\/unit\/rx-storage-implementations.test.ts\#L2493](https://github.com/pubkey/rxdb/blob/206b5a6f1bbd2a09e9942ef4c615d02cbed8e19b/test/unit/rx-storage-implementations.test.ts#L2493) - [test\/unit\/rx-storage-implementations.test.ts\#L2497](https://github.com/pubkey/rxdb/blob/206b5a6f1bbd2a09e9942ef4c615d02cbed8e19b/test/unit/rx-storage-implementations.test.ts#L2497) - `error TS2339: Property 'operation' does not exist on type 'EventBulk, any>'.` - [test\/unit\/rx-storage-implementations.test.ts\#L2496](https://github.com/pubkey/rxdb/blob/206b5a6f1bbd2a09e9942ef4c615d02cbed8e19b/test/unit/rx-storage-implementations.test.ts#L2496) - `error TS2339: Property 'documentData' does not exist on type 'EventBulk, any>'.` - [test\/unit\/rx-storage-implementations.test.ts\#L2709](https://github.com/pubkey/rxdb/blob/206b5a6f1bbd2a09e9942ef4c615d02cbed8e19b/test/unit/rx-storage-implementations.test.ts#L2709)
typescript-bot commented 9 months ago

quilljs/quill

### [packages\/quill\/tsconfig.json](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/tsconfig.json) - `error TS2578: Unused '@ts-expect-error' directive.` - [packages\/quill\/src\/core\/quill.ts\#L272](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/core/quill.ts#L272) - [packages\/quill\/src\/core\/quill.ts\#L408](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/core/quill.ts#L408) - [packages\/quill\/src\/modules\/toolbar.ts\#L119](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/modules/toolbar.ts#L119) - [packages\/quill\/src\/modules\/toolbar.ts\#L121](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/modules/toolbar.ts#L121) - [packages\/quill\/src\/modules\/toolbar.ts\#L135](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/modules/toolbar.ts#L135) - [packages\/quill\/src\/modules\/toolbar.ts\#L140](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/modules/toolbar.ts#L140) ### [tsconfig.json](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/tsconfig.json) - `error TS1292: 'Quill' resolves to a type and must be marked type-only in this file before re-exporting when 'verbatimModuleSyntax' is enabled. Consider using 'export type { Quill as default }'.` - [packages\/quill\/src\/core.ts\#L41](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/core.ts#L41) - [packages\/quill\/src\/quill.ts\#L111](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/quill.ts#L111) - `error TS2578: Unused '@ts-expect-error' directive.` - [packages\/quill\/src\/core\/quill.ts\#L272](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/core/quill.ts#L272) - [packages\/quill\/src\/core\/quill.ts\#L408](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/core/quill.ts#L408) - [packages\/quill\/src\/modules\/toolbar.ts\#L119](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/modules/toolbar.ts#L119) - [packages\/quill\/src\/modules\/toolbar.ts\#L121](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/modules/toolbar.ts#L121) - [packages\/quill\/src\/modules\/toolbar.ts\#L135](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/modules/toolbar.ts#L135) - [packages\/quill\/src\/modules\/toolbar.ts\#L140](https://github.com/quilljs/quill/blob/828e0dff876771e363fc296821b70b58c372b356/packages/quill/src/modules/toolbar.ts#L140)
typescript-bot commented 9 months ago

react-hook-form/react-hook-form

**2 of 3 projects failed to build with the old tsc and were ignored** ### [tsconfig.json](https://github.com/react-hook-form/react-hook-form/blob/4c21b288744b3271e0ec3780d8d9cbccc2708665/tsconfig.json) - `error TS7006: Parameter 'values' implicitly has an 'any' type.` - [src\/logic\/createFormControl.ts\#L1333](https://github.com/react-hook-form/react-hook-form/blob/4c21b288744b3271e0ec3780d8d9cbccc2708665/src/logic/createFormControl.ts#L1333)
typescript-bot commented 9 months ago

reduxjs/react-redux

**2 of 3 projects failed to build with the old tsc and were ignored** ### [test\/typetests\/tsconfig.json](https://github.com/reduxjs/react-redux/blob/9ce28abbfe433580fb4a0ecd66dd930e0325700c/test/typetests/tsconfig.json) - `error TS2313: Type parameter 'U' has a circular constraint.` - [test\/typeTestHelpers.ts\#L50](https://github.com/reduxjs/react-redux/blob/9ce28abbfe433580fb4a0ecd66dd930e0325700c/test/typeTestHelpers.ts#L50) - `error TS2578: Unused '@ts-expect-error' directive.` - [test\/typeTestHelpers.ts\#L72](https://github.com/reduxjs/react-redux/blob/9ce28abbfe433580fb4a0ecd66dd930e0325700c/test/typeTestHelpers.ts#L72)
typescript-bot commented 9 months ago

refined-github/refined-github

### [tsconfig.json](https://github.com/refined-github/refined-github/blob/631af562ae1ef64bbc86daef95361547725b18c9/tsconfig.json) - `error TS2344: Type 'ParseSelector' does not satisfy the constraint 'HTMLElement'.` - [source\/helpers\/fetch-dom.ts\#L8](https://github.com/refined-github/refined-github/blob/631af562ae1ef64bbc86daef95361547725b18c9/source/helpers/fetch-dom.ts#L8) - [source\/helpers\/select-has.ts\#L9](https://github.com/refined-github/refined-github/blob/631af562ae1ef64bbc86daef95361547725b18c9/source/helpers/select-has.ts#L9) - `error TS2344: Type 'ExpectedElement' does not satisfy the constraint 'Element'.` - [source\/helpers\/selector-observer.tsx\#L18](https://github.com/refined-github/refined-github/blob/631af562ae1ef64bbc86daef95361547725b18c9/source/helpers/selector-observer.tsx#L18) - [source\/helpers\/selector-observer.tsx\#L42](https://github.com/refined-github/refined-github/blob/631af562ae1ef64bbc86daef95361547725b18c9/source/helpers/selector-observer.tsx#L42) - `error TS2339: Property 'classList' does not exist on type 'ExpectedElement'.` - [source\/helpers\/selector-observer.tsx\#L23](https://github.com/refined-github/refined-github/blob/631af562ae1ef64bbc86daef95361547725b18c9/source/helpers/selector-observer.tsx#L23) - [source\/helpers\/selector-observer.tsx\#L28](https://github.com/refined-github/refined-github/blob/631af562ae1ef64bbc86daef95361547725b18c9/source/helpers/selector-observer.tsx#L28) - `error TS2339: Property 'matches' does not exist on type 'ExpectedElement'.` - [source\/helpers\/selector-observer.tsx\#L23](https://github.com/refined-github/refined-github/blob/631af562ae1ef64bbc86daef95361547725b18c9/source/helpers/selector-observer.tsx#L23) - `error TS2345: Argument of type 'ObserverListener' is not assignable to parameter of type 'ObserverListener'.` - [source\/helpers\/selector-observer.tsx\#L69](https://github.com/refined-github/refined-github/blob/631af562ae1ef64bbc86daef95361547725b18c9/source/helpers/selector-observer.tsx#L69)
typescript-bot commented 9 months ago

vuejs/core

**1 of 3 projects failed to build with the old tsc and were ignored** ### [tsconfig.build.json](https://github.com/vuejs/core/blob/ee4cd78a06e6aa92b12564e527d131d1064c2cd0/tsconfig.build.json) - `error TS2742: The inferred type of 'resolveParserPlugins' cannot be named without a reference to 'packages/compiler-core/node_modules/@babel/parser/typings/babel-parser'. This is likely not portable. A type annotation is necessary.` - [packages\/compiler-sfc\/src\/script\/context.ts\#L161](https://github.com/vuejs/core/blob/ee4cd78a06e6aa92b12564e527d131d1064c2cd0/packages/compiler-sfc/src/script/context.ts#L161) - `error TS2322: Type 'T | DeepReadonly>>' is not assignable to type 'T'.` - [packages\/reactivity\/src\/reactive.ts\#L410](https://github.com/vuejs/core/blob/ee4cd78a06e6aa92b12564e527d131d1064c2cd0/packages/reactivity/src/reactive.ts#L410) ### [tsconfig.json](https://github.com/vuejs/core/blob/ee4cd78a06e6aa92b12564e527d131d1064c2cd0/tsconfig.json) - `error TS2322: Type 'T | DeepReadonly>>' is not assignable to type 'T'.` - [packages\/reactivity\/src\/reactive.ts\#L410](https://github.com/vuejs/core/blob/ee4cd78a06e6aa92b12564e527d131d1064c2cd0/packages/reactivity/src/reactive.ts#L410)
MichaelMitchell-at commented 9 months ago

Copying over my comment from #56972

Minimal repro of a "cannot be used as an index type" error:

type Type = {prop: 'a', otherProp: unknown}

type X = 'prop' extends keyof Type
    ? Type['prop']
           ^^^^^^ Type '"prop"' cannot be used as an index type.(2538)
    : never;
RyanCavanaugh commented 9 months ago

@MichaelMitchell-at fix at #57113

RyanCavanaugh commented 9 months ago

react-redux is trying to do the should-be-impossible and prevent function arguments from subtyping with this function

export function expectExactType<T>(t: T) {
  return <U extends Equals<T, U>>(u: U) => {}
}

demonstrated here:

// @ts-expect-error
expectExactType('5' as string)('5' as const)

and also to prevent any from bypassing errors

// @ts-expect-error
expectExactType('5' as any)('5' as const)

To the extent they once succeeded, they're now broken by #56515. However, this functionality was never used AFAICT, every call is in the form e.g.

expectExactType<AppStore>(store)

so I don't think this is a blocker for that project in particular.

Andarist commented 9 months ago

@MichaelMitchell-at fix at https://github.com/microsoft/TypeScript/pull/57113

It's worth noting that this is a fix for the @MichaelMitchell-at's minimal repro case but that minimal repro case likely isn't related to Drizzle's "cannot be used as an index type" problems (I know you have already bisected this to the PR that caused this particular change). Unless I'm mistaken, we only have changes between 5.3 and 5.4 reported here (the title of the issue suggests so :P) - and that minimal repro case already doesn't typecheck with 5.3

jakebailey commented 9 months ago

Unless I'm mistaken, we only have changes between 5.4 and 5.4 reported here (the title of the issue suggests so :P) - and that minimal repro case already doesn't typecheck with 5.3

This PR compares errors between 5.3.3 and 5.4.0-dev.20240121 (not 5.4 and 5.4); but if it didn't build with 5.3, common errors will be ignored.

Andarist commented 9 months ago

That was just a typo - I meant what you have confirmed 😉 That minimal repro didn't typecheck with 5.3 so it just continues to be an error with the current nightly of 5.4 and because of that it's unlikely to be related to any errors reported here.

andrewbranch commented 9 months ago

@ahejlsberg react-hook-form repro:

type AsyncDefaultValues<TFieldValues> = (
  payload?: unknown,
) => Promise<TFieldValues>;

type DefaultValues<TFieldValues> =
  TFieldValues extends AsyncDefaultValues<TFieldValues>
    ? Awaited<TFieldValues>
    : TFieldValues;

function f<T extends Record<string, any>>(options: DefaultValues<T> | AsyncDefaultValues<T>) {
  if (typeof options === 'function') {
    options().then((data) => data);
  }
}

https://www.typescriptlang.org/play?module=1&ts=5.4.0-dev.20240124#code/C4TwDgpgBAggziAdgYwCIQGYEMCuAbYANSzxwjgB4AVAMQEsI8ATY08gPigF4oAKAKChQwWEHgD2WJgH4AXFByIA1onEB3RABp+ASm6cACgCdxAWzpwI1eoxYkycdgG5+-UJCjps+IvfLWGZlYHTi5BKFpAuzY4KAgAD2AIRCZY+CQ0TFwCYP9I21zHcKFpWDUsOiSmAIK-IqEheXygupd+DEVkYDpxRCgMajjE5NSoACUIZHEjarhgIzpEAHNNKCxEEHZ2XnEwbt64eS9s3xjqTgAfWAQUY59C870Ab3C6DD53CHF33f3EWK4gKgAHIOig-sDnsUoL8ev9eDoAHTAAAWyV4vCYWGAWD0XE4WJxOhcQgAvvxyUA

sandersn commented 9 months ago

I double checked qwik. The errors below are definitely caused by #56598. I manually reverted that PR's checker diff and the errors went away. I'll try to make a small repro.

error TS2345: Argument of type 'EventQRL<T>' is not assignable to parameter of type 'EventQRL<"copy" | "progress" | "reset" | "scroll" | "resize" | "drag" | "fullscreenchange" | "fullscreenerror" | "abort" | "animationcancel" | "animationend" | "animationiteration" | ... 112 more ... | "qvisible">'.
ahejlsberg commented 9 months ago

Regarding the new react-hook-form error, the issue is the Record<string, any> constraint on T. We have rule that says an object with an [x: string]: any index signature is a supertype of any object type, even if that object type doesn't have a matching index signature. This includes function types, so in the example, the typeof options === "function" check can't just narrow the type to AsyncDefaultValues<T>. Indeed, options could be any arbitrary function. To wit, this call is permitted:

f(() => "hello");

The reason we issue an implicit any error on the data parameter is that, since the function check can really only narrow to type Function, we end up with an untyped function call.

Things work fine when the constraint of T is changed to Record<string, unknown>. In that case we error on calls to f with arbitrary function types, and we narrow to AsyncDefaultValues<T> following the function check.

Other than adding a type assertion, I'm not sure what the best fix is in the react-hook-form project since new errors pop up if I just change the constraint to Record<string, unknown>. But, certainly, I think our is correct and points out a latent issue in the code.

sandersn commented 9 months ago

Here's an independent repro for qwik's use-on errors. This one fails after https://github.com/microsoft/TypeScript/pull/56598 and passes before (where 'before' includes https://github.com/microsoft/TypeScript/pull/56004 -- though both are required for the error to appear.)

(I'll have a much smaller repro soon; this is just the first one that is independent of qwik)

export type Q<TYPE = unknown> = {
  // Special type brand to let eslint that the Type is serializable
  __qwik_serializable__?: any;
  __brand__Q__: TYPE;

  /** Resolve the Q and return the actual value. */
  resolve(): Promise<TYPE>;
  /** The resolved value, once `resolve()` returns. */
  resolved: undefined | TYPE;

  getCaptured(): unknown[] | null;
  getSymbol(): string;
  getHash(): string;
}
type Handler<EV = Event, EL = {}> = {
  bivarianceHack(event: EV, element: EL): any;
}['bivarianceHack'];
type VirtualKeys = keyof WMap
interface E { }
interface WMap {
    "boo": E;
}
type AllEventsMap = WMap
type LcEvent<T extends string, C extends string = Lowercase<T>> = C extends keyof AllEventsMap
  ? AllEventsMap[C]
  : Event;
type VirtualEvent<T extends string = VirtualKeys> =
  | Q<Handler<LcEvent<T>, {}>>
  | undefined;
type Stringy<LiteralType, BaseType extends null | undefined | string | number | boolean | symbol | bigint> =
  | LiteralType
  | (BaseType & Record<never, never>);
type VirtualEventNames = Stringy<VirtualKeys, string>; // VirtualKeys | (string & { });
declare const _virtualOn: (eventQrl: VirtualEvent<VirtualKeys>) => void;
export const virtualOn = <T extends VirtualEventNames>(eventQrl: VirtualEvent<T>) => {
  _virtualOn(eventQrl); // error here where none was before
};

Smaller:

// interesting things:
// 1. only errors if event in EMap is all lowercase.
// 2. bivariance hack is required
// 3. Lowercase<T> is required
type EMap = { event: {} }
type Keys = keyof EMap
type EPlusFallback<C> = C extends Keys
  ? EMap[C]
  : "unrecognised event";
type VirtualEvent<T extends string> = { bivarianceHack(event: EPlusFallback<Lowercase<T>>): any; }['bivarianceHack'];
type KeysPlusString = Keys | (string & Record<never, never>);
declare const _virtualOn: (eventQrl: VirtualEvent<Keys>) => void;
export const virtualOn = <T extends KeysPlusString>(eventQrl: VirtualEvent<T>) => {
  _virtualOn(eventQrl);
};
sandersn commented 9 months ago

The error is the one @RyanCavanaugh and @ahejlsberg found before--KeysPlusString is correctly not assignable to Keys in VIrtualEvent.

The error seems to show that the conditional type EPlusFallback isn't assignable to its base contraint:

Argument of type '(event: EPlusFallback<Lowercase<T>>) => any' is not assignable to parameter of type '(event: {}) => any'.
  Types of parameters 'event' and 'event' are incompatible.
    Type '{}' is not assignable to type 'EPlusFallback<Lowercase<T>>'.ts(2345)

EPlusFallback<Lowercase<T>> should have the base constraint {} | "unrecognised event", but I guess that assignability doesn't try that.

Also: I guess assignability to Lowercase<T> must go through isValidTypeForTemplateLiteralPlaceholder, because that's the only thing that looks relevant to #56598.

ahejlsberg commented 9 months ago

@sandersn I tried reverting #56598 and it doesn't seem to have any effect. Your repro still errors in the same way. So I think the issue is just caused by #56004.

sandersn commented 9 months ago

It repros for me, so maybe it's the tsconfig I'm using. I'll create a standalone repo.

Example run of before/after showing no error/error ``` ✔ ~/ts [main|⚑ 1] 14:30 $ git checkout e5513254a3 Note: switching to 'e5513254a3'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at e5513254a3 Fixed symbol lookup for binding expando properties in blocks (#56552) ✔ ~/ts [:e5513254a3|⚑ 1] 14:31 $ b Using ~/ts/Herebyfile.mjs to run tsc Starting lib Starting generate-diagnostics > /home/nathansa/.nvm/versions/node/v20.11.0/bin/node scripts/processDiagnosticMessages.mjs src/compiler/diagnosticMessages.json Reading diagnostics from src/compiler/diagnosticMessages.json Finished lib in 33ms Finished generate-diagnostics in 63ms Starting bundle-tsc Finished bundle-tsc in 179ms Completed tsc in 242ms ✔ ~/ts [:e5513254a3|⚑ 1] 14:31 $ pushd ~/src/test ~/ts t✔ ~/src/test [master L|✚ 15…16] 14:31 $ tsl ✔ ~/src/test [master L|✚ 15…16] 14:31 $ pushd ~/ts ~/src/test ✔ ~/ts [:e5513254a3|⚑ 1] 14:31 $ git checkout 68b9b07 Previous HEAD position was e5513254a3 Fixed symbol lookup for binding expando properties in blocks (#56552) HEAD is now at 68b9b07264 Consistently check assignability to template literal placeholders (#56598) ✔ ~/ts [:68b9b07264|⚑ 1] 14:31 $ b Using ~/ts/Herebyfile.mjs to run tsc Starting lib Starting generate-diagnostics > /home/nathansa/.nvm/versions/node/v20.11.0/bin/node scripts/processDiagnosticMessages.mjs src/compiler/diagnosticMessages.json Reading diagnostics from src/compiler/diagnosticMessages.json Finished lib in 32ms Finished generate-diagnostics in 61ms Starting bundle-tsc puFinished bundle-tsc in 190ms Completed tsc in 252ms s✔ ~/ts [:68b9b07264|⚑ 1] 14:31 $ pushd ~/src/test ~/ts ✔ ~/src/test [master L|✚ 15…16] 14:31 $ tsl welove.ts:22:14 - error TS2345: Argument of type '(event: EPlusFallback>) => any' is not assignable to parameter of type '(event: {}) => any'. Types of parameters 'event' and 'event' are incompatible. Type '{}' is not assignable to type 'EPlusFallback>'. 22 _virtualOn(eventQrl); ~~~~~~~~ Found 1 error in welove.ts:22 ✘-2 ~/src/test [master L|✚ 15…16] ```
sandersn commented 9 months ago

Here's the standalone repo: https://github.com/sandersn/repro56598

ahejlsberg commented 9 months ago

Ok, I see the same effects with your repro. The root cause is #56004, but the issue only shows up after #56598 because that PR fixes template literal placeholder matching such that `${string & Record<never, never>}` behaves the same as just `${string}` (which indeed it should). And apparently we use template literal matching when checking relations for two string mapping types (this happens in isMemberOfStringMapping). Crazy.

ahejlsberg commented 9 months ago

Anyway, this means the repro can be reduced to:

type EMap = { event: {} }
type Keys = keyof EMap
type EPlusFallback<C> = C extends Keys ? EMap[C] : "unrecognised event";
type VirtualEvent<T extends string> = { bivarianceHack(event: EPlusFallback<Lowercase<T>>): any; }['bivarianceHack'];
declare const _virtualOn: (eventQrl: VirtualEvent<Keys>) => void;
export const virtualOn = <T extends string>(eventQrl: VirtualEvent<T>) => {
  _virtualOn(eventQrl);
};
ahejlsberg commented 9 months ago

Ok, I now see what's going on.

The repro checks whether EPlusFallback<Lowercase<T>> is assignable to EPlusFallback<Keys> (which is just {}).

With #56004, the constraint of EPlusFallback<Lowercase<T>> ends up correctly being type EMap["event" & Lowercase<T>] | "unrecognized event", where previously it would just be "unrecognized event".

The constraint of EMap["event" & Lowercase<T>] in turn is reduced to EMap["event" & Lowercase<string>].

This is where things go wrong. We currently lack the ability to reduce unions and intersections of string literal types (like "event") and string mapping types with non-generic placeholders (like Lowercase<string>). The intersection "event" & Lowercase<string> really should reduce to just "event", but it doesn't. So, we fail to consider it a valid index type in EMap["event" & Lowercase<string>], which therefore ends up being unknown. And unknown isn't assignable to {}, so therefore error.

So, long story short, we can fix this issue by doing a better job reducing unions and intersections of string literal types and string mapping types with non-generic placeholders. I will look at putting up a PR.