Description
TypeScript Version: 3.6.3, actually most likely all versions since v3.2
Search Terms: composite, resolveJSONModule, tsserver, TS6307, include pattern
Code
Not particularly easy to show with code, but here's a repro:
https://github.com/lierdakil/ts6307-composite-json-tsserver-test
- Clone
- Run
npm install
- Run
node test.js
in a terminal - Observe output
- Kill
test.js
(ctrl+C or whathaveyou)
Note: test.js
just spawns tsserver
and tells it to open src/test.ts
.
Please see README for a complete listing.
Expected behavior:
No error diagnostics.
Actual behavior:
In tsserver output, we see:
{"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"src/test.ts","configFile":"tsconfig.json","diagnostics":[{"text":"File '/tmp/test/src/blabla.json' is not listed within the file list of project 'tsconfig.json'. Projects must list all files or use an 'include' pattern.","code":6307,"category":"error"}]}}
That is, TS6307 on a JSON file, which is included in the project via include
pattern.
Additional observations:
- Issue only manifests when
composite: true
. - Issue only manifests in
tsserver
, but not intsc
itself. - Issue only manifests when
tsconfig.json
usesinclude
, but not when it usesfiles
.
Related Issues:
#25636 #30785, also see PR #27844
Other related issues (from external projects):
TypeStrong/ts-loader#905
TypeStrong/atom-typescript#1512