-
Notifications
You must be signed in to change notification settings - Fork 12.8k
include
patterns need to specifiy .json
extension in composite projects despite resolveJsonModule: true
#55366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The json files are not included by include pattern unless you specify the ".json" extension so per your include pattern in tsconfig the root files is "index.ts" and does not include "data.json". Composite wants you to list all input files and data.json is not part of your config and hence error. This is working as per design. When you look at explain files it shows that "data.json" is included only through import and not any of the config file rules.
You can fix this as suggested in #25636 by either adding We also have test case
Line 95 in 8863e2f
TypeScript/tests/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js Line 74 in 8863e2f
|
While this may be what you intended when implementing, it's not intuitive from a user perspective. |
Given that data.json will be copied to your But while writing above comment i realised, your config doesnt have Note that if we change this, it also means that not listing |
…y in the config since they will not be emitted Fixes #55366
🔎 Search Terms
include composite resolveJsonModule
Reopening of #25636 which doesn't seem to have fixed all problems reported in that issue
🕗 Version & Regression Information
This is the behavior in every version I tried (up until 4.1)
⏯ Playground Link
https://github.com/eps1lon/ts-references-json
💻 Code
🙁 Actual behavior
Explicitly adding
.json
toinclude
like #25636 (comment) suggested works also but is unintuitive since the extension is only required in composite projects.🙂 Expected behavior
Compiles just fine without having to add another
include
pattern using.json
.The text was updated successfully, but these errors were encountered: