Possible Regression: resolveJsonModule Projects must list all files or use an 'include' pattern.
See original GitHub issueTypeScript Version: 3.7.0-dev.20190912
Search Terms:
resolveJsonModule
Projects must list all files or use an 'include' pattern
Code
tsconfig.json
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"strictNullChecks": true,
"resolveJsonModule": true
},
"include": ["src/**/*.ts", "src/**/*.json"],
"references": []
}
tsconfig.base.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es2017",
"lib": ["es2017"],
"composite": true,
"esModuleInterop": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"sourceMap": true,
"skipLibCheck": true
}
}
Expected behavior:
When resolveJsonModule
is turned on, and json files have been included in the includes
array, I should be able to import json files with no trouble.
Actual behavior:
When I use the above tsconfig options, and include a json file, I get the following error:
Related Issues:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Project must list all files or use an 'include' pattern
In my case I was builiding a monorepo and referencing one of the packages into another package. All I had to do was...
Read more >tsconfig resolvejsonmodule | The Search Engine You Control
You need two different TS configs because the project is using two different environments in ... Projects must list all files or use...
Read more >TypeScript complains about files not included, ignoring ...
I have a project using yarn workspaces with the top level tsconfig.json referencing individual ... Projects must list all files or use an...
Read more >How to generate a tsconfig.json file | bobbyhadz
To generate a `tsconfig.json` file, open your terminal in your project's root directory. Install typescript globally: `npm install typescript@latest -g`.
Read more >Untitled
Note: each of the workspaces (packages) need to have a package. ... file is included in, scanning folders from the file folder up...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Why do I need to do that even I have
--resolveJsonModule
on?In the document of
includes
. I think.json
should be included too whenresolveJsonModule
is on.Thank you, that fixes compilation, after restarting VSCode