I would like to use PnP js with SPFX 1.1
The article here: https://github.com/pnp/pnpjs/blob/version-2/docs/SPFx-on-premises.md says that we use SPFx 1.4.1 for SharePoint 2016 too, is that correct? Isn't 1.4.1 only for SP 2019 and onwards? Are the steps for 2016 the same?
I followed same steps in my 2016 environment, it never works. I removed both node_modules and package-lock.json, did npm i, then changed all typescript references in the new package-lock.json to 3.6.4, then did npm install again. I still get errors such as:
Error - typescript - node_modules\@pnp\common\util.d.ts(65,57): error TS1005: ',' expected.
Error - typescript - node_modules\@pnp\common\util.d.ts(65,90): error TS1005: ',' expected.
Error - 'typescript' sub task errored after 3.67 s
"TypeScript error(s) occurred."
Is it supposed to work in 2016. It seems to me impossible to make it work in 2016, not sure if anyone actually tried it.
It even works for SP 2013 for me (none-SPFx, of course in that case). But toolchains and build configs have to be aligned and tweaked to support or ignore some TS features. This is a more general question for SPFx for on-prem and their plans to support or do not support up-to-date tools.
Regarding the error, skipLibCheck in tsconfig.json should help. Please see more.
Is SPFx shipping with strict null checks on and skip lib check off?
skipLibCheck never works. It doesn't have any effect in that case. Where do I post about this issue? Isn't this the right location?
We are trying to help but you keep saying things "never work" in cases where they have worked for others. Can you provide a repo we can clone to reproduce the issue? Understand you are frustrated but the guidance has worked for others and since it doesn't for you we need some more information to help get you going.
Going to close this one as there haven't been any updates in some time. If you are still having trouble please open a new issue, ref this one, and provide any additional details you can. Thanks!
Most helpful comment
We are trying to help but you keep saying things "never work" in cases where they have worked for others. Can you provide a repo we can clone to reproduce the issue? Understand you are frustrated but the guidance has worked for others and since it doesn't for you we need some more information to help get you going.