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
fails to compile because it uses not the correct tsconfig:
.\node_modules\.bin\tsc.cmd --build .\src\ --verbose --explainFiles
[16:15:17] Projects in this build:
* src/tsconfig.json
[16:15:17] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors.
[16:15:17] Building project '/ts-issues/src/tsconfig.json'...
jsModule/jsModule.ts:3:13 - error TS2550: Property 'allSettled' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later.
3 Promise.allSettled([])
~~~~~~~~~~
node_modules/typescript/lib/lib.es5.d.ts
Library referenced via 'es5' from file 'node_modules/typescript/lib/lib.es2015.d.ts'
node_modules/typescript/lib/lib.es2015.d.ts
[...]
node_modules/typescript/lib/lib.decorators.d.ts
Library referenced via 'decorators' from file 'node_modules/typescript/lib/lib.es5.d.ts'
node_modules/typescript/lib/lib.decorators.legacy.d.ts
Library referenced via 'decorators.legacy' from file 'node_modules/typescript/lib/lib.es5.d.ts'
jsModule/jsModule.ts
Imported via "../jsModule/jsModule.js" from file 'src/main.ts'
src/main.ts
Part of 'files' list in tsconfig.json
Found 1 error.
π Expected behavior
The build failure is surprising.
Expected would be one of
The files are not included (or referenced) in src/tsconfig.json so they should not be rebuild (but only .d.ts files consumed) or
if this needs to be rebuild it should be correctly based on its tsconfig.json
Additional information about the issue
With my real code these folders are different VS 2022 projects and therefore have no references.
Instead I have many different tsconfig.json files for the esm files. So wildly importing some ts files into the compile will never get a reasonable output. (but break the output js files in imported folder).
Found #15272 but we had no references back in 2017.
Perhaps is this a simplified version of #58353
The text was updated successfully, but these errors were encountered:
The files are not included (or referenced) in src/tsconfig.json so they should not be rebuild (but only .d.ts files consumed) or
This is working as intended. The included files are the starting point of the compilation, but whatever local files you import become part of the compilation.
π Search Terms
module import declaration
π Version & Regression Information
β― Playground Link
https://github.com/HolgerJeromin/ts-issues/tree/ts-61440
π» Code
Folder
jsModule
with tsconfig and one module file:file
jsModule/jsModule.ts
jsModule/tsconfig.json
And a folder
src
:file
src/main.ts
src/tsconfig.json
Note: No
ES2020
lib.π Actual behavior
Build jsModule folder:
Results in emit of correct
jsModule/jsModule.js
and.d.ts
file.Build src folder:
fails to compile because it uses not the correct tsconfig:
.\node_modules\.bin\tsc.cmd --build .\src\ --verbose --explainFiles [16:15:17] Projects in this build: * src/tsconfig.json [16:15:17] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. [16:15:17] Building project '/ts-issues/src/tsconfig.json'... jsModule/jsModule.ts:3:13 - error TS2550: Property 'allSettled' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later. 3 Promise.allSettled([]) ~~~~~~~~~~ node_modules/typescript/lib/lib.es5.d.ts Library referenced via 'es5' from file 'node_modules/typescript/lib/lib.es2015.d.ts' node_modules/typescript/lib/lib.es2015.d.ts [...] node_modules/typescript/lib/lib.decorators.d.ts Library referenced via 'decorators' from file 'node_modules/typescript/lib/lib.es5.d.ts' node_modules/typescript/lib/lib.decorators.legacy.d.ts Library referenced via 'decorators.legacy' from file 'node_modules/typescript/lib/lib.es5.d.ts' jsModule/jsModule.ts Imported via "../jsModule/jsModule.js" from file 'src/main.ts' src/main.ts Part of 'files' list in tsconfig.json Found 1 error.
π Expected behavior
The build failure is surprising.
Expected would be one of
src/tsconfig.json
so they should not be rebuild (but only.d.ts
files consumed) ortsconfig.json
Additional information about the issue
With my real code these folders are different VS 2022 projects and therefore have no
references
.Instead I have many different tsconfig.json files for the esm files. So wildly importing some
ts
files into the compile will never get a reasonable output. (but break the output js files in imported folder).Found #15272 but we had no references back in 2017.
Perhaps is this a simplified version of #58353
The text was updated successfully, but these errors were encountered: