-
Notifications
You must be signed in to change notification settings - Fork 1k
🐞 tslint-microsoft-contrib missing in dependency chain causing tsline build error when using PNPM (extra work req. for PNPM usage) #2916
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
I noticed this yesterday. It looks like an issue with PNPM itself, as the tslint-microsoft-contrib package is listed as a dependency of the @microsoft/sp-tslint-rules package, but it isn't getting pulled down. We'll reach out to Zoltan and see what's going on. He's normally extremely helpful and responsive. |
I noticed that too... but couldn't track down the cause. Wonder if it's an issue between a scoped package referencing an unscoped package? |
What version of pnpm are you using? I'm on the latest, but I'm going to downgrade to 2.15.1 and see if it still happens. :( still happens. We're digging in further. |
OK, we sorted this out. It sounds like (according to @iclanton ) an issue with tslint, where they don't correctly resolve node dependencies. We're looking at submitting a PR to tslint, but in the meantime if you add "tslint-microsoft-contrib": "5.2.1", as a dev dependency, it should work. We'll look at patching the generator to do that manually if the fix to tslint takes a while to prop. |
Great find... thanks @patmill ! |
If I run yo @microsoft/sharepoint --skip-install
pnpm install
pnpm install tslint-microsoft-contrib@5.2.1 --save-dev
gulp I now get
@patmill Do I still need to use flatten, or is what would the proper order of commands be? |
@wobba - yeah, looks like that suggestion doesn't work. We'll keep digging into this. |
I filed an issue with pnpm. It does seem to be a pnpm issue. I'll see if I can come up with a workaround. |
We found 2 separate issues. The first issue is that tslint is not resolving symlinks correctly. @iclanton has a fix for that he is trying to merge. The second is an unmet peer dependency for |
With SPFx 1.8.2 I'm getting
|
|
With the latest builds of spfx (1.13.0) and pnpm (6.19.0). I'm not seeing issues any more with the scaffolded code. |
That's great news @patmill and a good reason to go to 1.13.0. I will upgrade and test myself. |
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues |
Category
Expected or Desired Behavior
Running
pnpm install
should get all dependencies so when building the project, it builds with no errors.Observed Behavior
When you run
pnpm install
, you don't get the tslint-microsoft-contrib package. To get it, you must runpnpm install --shamefully-flatten
. This causes a linting error when building:Ref: https://pnpm.js.org/docs/en/faq.html#pnpm-does-not-work-with-your-project-here
Steps to Reproduce
create a new project with the SPFx Yeoman generator:
yo @microsoft/genereator --skip-install
run
pnpm install
run
gulp build
observe linting error listed above
use solution 2 from the PNPM FAQ: run
pnpm install --shamefully-flatten
run
gulp build
observe no tslinting errors
Confirmed in SPFx v1.7.0
The text was updated successfully, but these errors were encountered: