microsoft / microsoft/TypeScript

SkipLibCheck fails to work in multi-project set-up

Offen
#36,503 2 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Needs Investigation
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

TypeScript Version: 3.8. Beta

Search Terms:
skiplibcheck

Steps to reproduce

  1. Extract the attached zip file to a folder and open repro.sln in Visual Studio (I'm using 2019)
  2. Expand the npm folder on project B and install the missing @azure/storage-blob package.
  3. 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Entpacke Repro.zip und öffne repro.sln in Visual Studio; erstelle dann die Lösung mit den Projekten A, B und C neu. Vergleiche das Verhalten, wenn A/foo/bar.ts nach A/bar.ts verschoben wird, und überprüfe die Projekteinstellungen rund um skiplibcheck. Fertig ist es, wenn der Multi-Projekt-Build ohne die gemeldeten Fehler TS2740 und TS2345 abgeschlossen wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
build-system, compilers
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.