microsoft / microsoft/TypeScript
SkipLibCheck fails to work in multi-project set-up
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 3.8. Beta
Search Terms:
skiplibcheck
Steps to reproduce
- Extract the attached zip file to a folder and open
repro.slnin Visual Studio (I'm using 2019) - Expand the
npmfolder on project B and install the missing@azure/storage-blobpackage. - Rebuild the solution.
Expected behavior:
No build errors.
Actual behavior:
2 errors:
error TS2740: Build:Type 'Buffer' is missing the following properties...
error TS2345: Build:Argument of type 'ErrnoException' is not assignable...
Explanation
We want have a custom definition for NodeJS. The npm package imported in Project B also has its own (incomplete) definition. So, we've added skiplibcheck to all the projects.
Project B builds fine by itself.
Project C references some NodeJS types. Project C also builds fine by itself.
Project A references types from both B and C.
When attempting to build A, we get the error above. But the error is for project C.
Basically, when building Project A, the skiplibcheck option is being ignored and the incomplete NodeJS definition from the imported package is being used.
Further Observations
Curiously, if file A/foo/bar.ts is moved to A/bar.ts (and the imports amended) the build compiles fine.
Attachment
Repro.zip
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Extract Repro.zip and open repro.sln in Visual Studio, then rebuild the solution with projects A, B, and C. Compare the behavior when A/foo/bar.ts is moved to A/bar.ts and inspect the project settings around skiplibcheck. Done means the multi-project build completes without the reported TS2740 and TS2345 errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100