microsoft / TypeScript

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

[NewErrors] 5.3.0-dev.20230820 vs 5.1.6 #55440

Closed typescript-bot closed 1 year ago

typescript-bot commented 1 year ago

The following errors were reported by 5.3.0-dev.20230820, but not by 5.1.6 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 112 of 200 visited repos | Outcome | Count | |---------|-------| | Detected interesting changes | 14 | | Detected no interesting changes | 98 | | Git clone failed | 2 | | Package install failed | 30 | | Project-graph error in old TS | 5 | | Too many errors in old TS | 46 | | Unknown failure | 5 |

Investigation Status

Repo Errors Outcome
alibaba/ice 2
backstage/backstage 1
darkreader/darkreader 2
facebook/docusaurus 2
fingerprintjs/fingerprintjs 2
fullcalendar/fullcalendar 2
graphql/graphql-js 5
lyswhut/lx-music-desktop 5
marmelab/react-admin 1
microsoft/playwright 1
ReactiveX/rxjs 1
redwoodjs/redwood 1
refined-github/refined-github 1
web3/web3.js 1
typescript-bot commented 1 year ago

alibaba/ice

**45 of 67 projects failed to build with the old tsc and were ignored** ### [packages\/shared\/tsconfig.json](https://github.com/alibaba/ice/blob/61a6908f68a925ff431133c1adfa132ba7967616/packages/shared/tsconfig.json) - `error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.` - [packages\/shared\/tsconfig.json\#L7](https://github.com/alibaba/ice/blob/61a6908f68a925ff431133c1adfa132ba7967616/packages/shared/tsconfig.json#L7) ### [packages\/miniapp-react-dom\/tsconfig.json](https://github.com/alibaba/ice/blob/61a6908f68a925ff431133c1adfa132ba7967616/packages/miniapp-react-dom/tsconfig.json) - `error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.` - [packages\/miniapp-react-dom\/tsconfig.json\#L7](https://github.com/alibaba/ice/blob/61a6908f68a925ff431133c1adfa132ba7967616/packages/miniapp-react-dom/tsconfig.json#L7)
typescript-bot commented 1 year ago

backstage/backstage

**6 of 13 projects failed to build with the old tsc and were ignored** ### [microsite\/tsconfig.json](https://github.com/backstage/backstage/blob/b2ff304ddd7e93958510cf1ed9319d4cc3572d86/microsite/tsconfig.json) - `error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.` - Project Scope
typescript-bot commented 1 year ago

darkreader/darkreader

**2 of 6 projects failed to build with the old tsc and were ignored** ### [src\/api\/tsconfig.json](https://github.com/darkreader/darkreader/blob/0b2b1cb26ff1e9ecb564a6d685a7cdba0e9a490c/src/api/tsconfig.json) - `error TS2531: Object is possibly 'null'.` - [src\/inject\/dynamic-theme\/css-rules.ts\#L15](https://github.com/darkreader/darkreader/blob/0b2b1cb26ff1e9ecb564a6d685a7cdba0e9a490c/src/inject/dynamic-theme/css-rules.ts#L15) ### [src\/tsconfig.json](https://github.com/darkreader/darkreader/blob/0b2b1cb26ff1e9ecb564a6d685a7cdba0e9a490c/src/tsconfig.json) - `error TS2531: Object is possibly 'null'.` - [src\/inject\/dynamic-theme\/css-rules.ts\#L15](https://github.com/darkreader/darkreader/blob/0b2b1cb26ff1e9ecb564a6d685a7cdba0e9a490c/src/inject/dynamic-theme/css-rules.ts#L15)
typescript-bot commented 1 year ago

facebook/docusaurus

**33 of 35 projects failed to build with the old tsc and were ignored** ### [packages\/create-docusaurus\/templates\/classic-typescript\/tsconfig.json](https://github.com/facebook/docusaurus/blob/0cb84b831db25012c60f13cf1db4a42174cf0ae2/packages/create-docusaurus/templates/classic-typescript/tsconfig.json) - `error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.` - Project Scope ### [examples\/classic-typescript\/tsconfig.json](https://github.com/facebook/docusaurus/blob/0cb84b831db25012c60f13cf1db4a42174cf0ae2/examples/classic-typescript/tsconfig.json) - `error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.` - Project Scope
typescript-bot commented 1 year ago

fingerprintjs/fingerprintjs

### [tsconfig.json](https://github.com/fingerprintjs/fingerprintjs/blob/6f1b3237b761436d9b72b81a07b95d5488fb2384/tsconfig.json) - `error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.` - [tsconfig.json\#L3](https://github.com/fingerprintjs/fingerprintjs/blob/6f1b3237b761436d9b72b81a07b95d5488fb2384/tsconfig.json#L3) ### [tsconfig.rollupConfig.json](https://github.com/fingerprintjs/fingerprintjs/blob/6f1b3237b761436d9b72b81a07b95d5488fb2384/tsconfig.rollupConfig.json) - `error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.` - Project Scope
typescript-bot commented 1 year ago

fullcalendar/fullcalendar

**1 of 3 projects failed to build with the old tsc and were ignored** ### [scripts\/config\/tsconfig.node.json](https://github.com/fullcalendar/fullcalendar/blob/7481ac9c119948640f3322ad31c9af76bb50d588/scripts/config/tsconfig.node.json) - `error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.` - [scripts\/config\/tsconfig.node.json\#L4](https://github.com/fullcalendar/fullcalendar/blob/7481ac9c119948640f3322ad31c9af76bb50d588/scripts/config/tsconfig.node.json#L4) in [scripts\/config\/tsconfig.node.json](https://github.com/fullcalendar/fullcalendar/blob/7481ac9c119948640f3322ad31c9af76bb50d588/scripts/config/tsconfig.node.json) ### [scripts\/tsconfig.safe.json](https://github.com/fullcalendar/fullcalendar/blob/7481ac9c119948640f3322ad31c9af76bb50d588/scripts/tsconfig.safe.json) - `error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.` - Project Scope in [scripts\/tsconfig.safe.json](https://github.com/fullcalendar/fullcalendar/blob/7481ac9c119948640f3322ad31c9af76bb50d588/scripts/tsconfig.safe.json)
typescript-bot commented 1 year ago

graphql/graphql-js

**1 of 2 projects failed to build with the old tsc and were ignored** ### [tsconfig.json](https://github.com/graphql/graphql-js/blob/75d419d7c6935745f99f7b14ff4b3901d813e6e9/tsconfig.json) - `error TS7022: 'doubles' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.` - [src\/execution\/\_\_tests\_\_\/mapAsyncIterable-test.ts\#L144](https://github.com/graphql/graphql-js/blob/75d419d7c6935745f99f7b14ff4b3901d813e6e9/src/execution/__tests__/mapAsyncIterable-test.ts#L144) - [src\/execution\/\_\_tests\_\_\/mapAsyncIterable-test.ts\#L208](https://github.com/graphql/graphql-js/blob/75d419d7c6935745f99f7b14ff4b3901d813e6e9/src/execution/__tests__/mapAsyncIterable-test.ts#L208) - `error TS2345: Argument of type '{ [Symbol.asyncIterator](): ...; next(): Promise<{ done: boolean; value: number; }>; }' is not assignable to parameter of type 'AsyncIterable | AsyncGenerator'.` - [src\/execution\/\_\_tests\_\_\/mapAsyncIterable-test.ts\#L144](https://github.com/graphql/graphql-js/blob/75d419d7c6935745f99f7b14ff4b3901d813e6e9/src/execution/__tests__/mapAsyncIterable-test.ts#L144) - [src\/execution\/\_\_tests\_\_\/mapAsyncIterable-test.ts\#L208](https://github.com/graphql/graphql-js/blob/75d419d7c6935745f99f7b14ff4b3901d813e6e9/src/execution/__tests__/mapAsyncIterable-test.ts#L208) - `error TS2322: Type '{ [variable: string]: unknown; } | undefined' is not assignable to type '{ [variable: string]: unknown; }'.` - [src\/execution\/execute.ts\#L349](https://github.com/graphql/graphql-js/blob/75d419d7c6935745f99f7b14ff4b3901d813e6e9/src/execution/execute.ts#L349) - `error TS2375: Type 'IteratorResult' is not assignable to type 'IteratorResult' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.` - [src\/execution\/mapAsyncIterable.ts\#L17](https://github.com/graphql/graphql-js/blob/75d419d7c6935745f99f7b14ff4b3901d813e6e9/src/execution/mapAsyncIterable.ts#L17) - `error TS2345: Argument of type 'T | R' is not assignable to parameter of type 'T'.` - [src\/execution\/mapAsyncIterable.ts\#L21](https://github.com/graphql/graphql-js/blob/75d419d7c6935745f99f7b14ff4b3901d813e6e9/src/execution/mapAsyncIterable.ts#L21)
typescript-bot commented 1 year ago

lyswhut/lx-music-desktop

**1 of 6 projects failed to build with the old tsc and were ignored** ### [src\/common\/tsconfig.json](https://github.com/lyswhut/lx-music-desktop/blob/c24d1d1e413b181593a690ee452eb5f476a5b5d6/src/common/tsconfig.json) - `error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.` - Project Scope ### [src\/lang\/tsconfig.json](https://github.com/lyswhut/lx-music-desktop/blob/c24d1d1e413b181593a690ee452eb5f476a5b5d6/src/lang/tsconfig.json) - `error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.` - Project Scope ### [src\/main\/tsconfig.json](https://github.com/lyswhut/lx-music-desktop/blob/c24d1d1e413b181593a690ee452eb5f476a5b5d6/src/main/tsconfig.json) - `error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.` - Project Scope ### [src\/renderer-lyric\/tsconfig.json](https://github.com/lyswhut/lx-music-desktop/blob/c24d1d1e413b181593a690ee452eb5f476a5b5d6/src/renderer-lyric/tsconfig.json) - `error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.` - Project Scope ### [src\/renderer\/tsconfig.json](https://github.com/lyswhut/lx-music-desktop/blob/c24d1d1e413b181593a690ee452eb5f476a5b5d6/src/renderer/tsconfig.json) - `error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.` - Project Scope
typescript-bot commented 1 year ago

marmelab/react-admin

**23 of 25 projects failed to build with the old tsc and were ignored** ### [packages\/create-react-admin\/tsconfig.json](https://github.com/marmelab/react-admin/blob/83dc1d61f0d7efaafebb57885d6b55f78509b581/packages/create-react-admin/tsconfig.json) - `error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node16'.` - [packages\/create-react-admin\/tsconfig.json\#L5](https://github.com/marmelab/react-admin/blob/83dc1d61f0d7efaafebb57885d6b55f78509b581/packages/create-react-admin/tsconfig.json#L5)
typescript-bot commented 1 year ago

microsoft/playwright

**4 of 14 projects failed to build with the old tsc and were ignored** ### [packages\/trace-viewer\/tsconfig.json](https://github.com/microsoft/playwright/blob/3ac61f5c49d6661c8aa12d31d75131bc074bcf6c/packages/trace-viewer/tsconfig.json) - `error TS2322: Type 'import("url").URL' is not assignable to type 'URL'.` - [packages\/playwright-core\/src\/utils\/network.ts\#L142](https://github.com/microsoft/playwright/blob/3ac61f5c49d6661c8aa12d31d75131bc074bcf6c/packages/playwright-core/src/utils/network.ts#L142)
typescript-bot commented 1 year ago

ReactiveX/rxjs

**8 of 13 projects failed to build with the old tsc and were ignored** ### [src\/tsconfig.types.json](https://github.com/ReactiveX/rxjs/blob/9aa16a9e1dfe73fd6c6ed4084e96d22847b63f9b/src/tsconfig.types.json) - `error TS2428: All declarations of 'WeakMap' must have identical type parameters.` - file:///home/vsts/work/1/s/typescript-5.3.0-dev.20230820/lib/lib.es2015.collection.d.ts#L62 in [src\/tsconfig.types.json](https://github.com/ReactiveX/rxjs/blob/9aa16a9e1dfe73fd6c6ed4084e96d22847b63f9b/src/tsconfig.types.json) - file:///home/vsts/work/1/s/typescript-5.3.0-dev.20230820/lib/lib.es2015.iterable.d.ts#L162 in [src\/tsconfig.types.json](https://github.com/ReactiveX/rxjs/blob/9aa16a9e1dfe73fd6c6ed4084e96d22847b63f9b/src/tsconfig.types.json) - file:///home/vsts/work/1/s/typescript-5.3.0-dev.20230820/lib/lib.es2015.symbol.wellknown.d.ts#L140 in [src\/tsconfig.types.json](https://github.com/ReactiveX/rxjs/blob/9aa16a9e1dfe73fd6c6ed4084e96d22847b63f9b/src/tsconfig.types.json) - file:///mnt/ts_downloads/rxjs/node_modules/@types/lodash/index.d.ts#L372 in [src\/tsconfig.types.json](https://github.com/ReactiveX/rxjs/blob/9aa16a9e1dfe73fd6c6ed4084e96d22847b63f9b/src/tsconfig.types.json)
typescript-bot commented 1 year ago

redwoodjs/redwood

**36 of 50 projects failed to build with the old tsc and were ignored** ### [docs\/tsconfig.json](https://github.com/redwoodjs/redwood/blob/8aa76885fdbdd603e2afdeef4d0abba1d0e75477/docs/tsconfig.json) - `error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.` - Project Scope
typescript-bot commented 1 year ago

refined-github/refined-github

### [tsconfig.json](https://github.com/refined-github/refined-github/blob/05099f2d2e0ba38d18b2145333e70eca86a68e2a/tsconfig.json) - `error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.` - [tsconfig.json\#L5](https://github.com/refined-github/refined-github/blob/05099f2d2e0ba38d18b2145333e70eca86a68e2a/tsconfig.json#L5)
typescript-bot commented 1 year ago

web3/web3.js

**55 of 62 projects failed to build with the old tsc and were ignored** ### [docs\/tsconfig.json](https://github.com/web3/web3.js/blob/1cdc86cd1543615cc30279199ed890d8abd285b1/docs/tsconfig.json) - `error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.` - Project Scope
GeoffWilliams commented 1 year ago

Hello! I have this error too in my project:

Typescript 5.2.2 gives the error:

tsconfig.json:28:15 - error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.

28     "module": "es2022",                                /* Specify what module code is generated. */
                 ~~~~~~~~

Code was previously working with typescript 5.1.6 and reverting the typescript version fixes the error. Heres my settings:

tsconfig.json

{
  "compilerOptions": {
    "target": "es2022",                                  /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
    "module": "es2022",                                /* Specify what module code is generated. */
    "moduleResolution": "node16",                     /* Specify how TypeScript looks up a file from a given module specifier. */
    "declaration": true,                              /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
    "outDir": "./dist",                                   /* Specify an output folder for all emitted files. */
    "esModuleInterop": true,                             /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
    "forceConsistentCasingInFileNames": true,            /* Ensure that casing is correct in imports. */
    "strict": true,                                      /* Enable all strict type-checking options. */
    "skipLibCheck": true                                 /* Skip type checking all .d.ts files. */
  },
  "include": [
    "src/"
  ]
}
nikimicallef commented 1 year ago

I am also getting this Node16 issue with the latest TypeScript version. Does anyone have any ideas on how to fix it?

EDIT: After some digging I seem to have fixed it. I just set the moduleResolution in my TSConfig to nodenext. The links which helped me out are the following: https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#module-and-moduleresolution-must-match-under-recent-node-js-settings https://github.com/microsoft/TypeScript/pull/54567 https://www.typescriptlang.org/tsconfig#moduleResolution https://github.com/cheeriojs/cheerio/pull/3251/files