microsoft / microsoft/TypeScript

SkipLibCheck fails to work in multi-project set-up

Ouverte
#36,503 2 commentaires 3 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Needs Investigation
Langage dominant
Go
Étoiles
111k
Forks
14.3k
Merge moyen
1 j 19 h
PR mergées (30 j)
117

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Extrayez Repro.zip et ouvrez repro.sln dans Visual Studio, puis reconstruisez la solution avec les projets A, B et C. Comparez le comportement lorsque A/foo/bar.ts est déplacé vers A/bar.ts et examinez les paramètres du projet autour de skiplibcheck. C’est terminé lorsque la build multiprojet s’achève sans les erreurs TS2740 et TS2345 signalées.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
build-system, compilers
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.