Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your
needs please complete the below template to ensure we have the details to help. Thanks!
Please check out the Docs to see if your question is already addressed there. This will help us ensure our documentation covers the most frequent questions.
Please specify what version of the library you are using: [ pnpjs 2 ]
Please specify what version(s) of SharePoint you are targeting: [ 2019 ]
If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.
If you are reporting an issue please describe the expected behavior. If you are suggesting an enhancement please
describe thoroughly the enhancement, how it can be achieved, and expected benefit. If you are asking a question, ask away!
If you are reporting an issue please describe the behavior you expected to occur when performing the action. If you are making a suggestion or asking a question delete this section.
Getting numerous typescript error when running gulp serve. Tried the fix suggested at https://pnp.github.io/pnpjs/SPFx-on-premises/ several times. Follow each step precisely but typescript version always returns to 2.4.1 after running npm install for the final time. I had this working for a few days and was successfully making api calls, but suddenly today around 2 I started getting build errors again and noticed that the typescript version had changed. Tried to run through the same steps I used to fix it the first time, but now can't get the version to stick in package-lock.json upon npm install.
If you are reporting an issue please describe the steps to reproduce the bug in sufficient detail to allow testing. If you are making
a suggestion or asking a question delete this section.
import import { sp } from "@pnp/sp/presets/all"
run gulp serve
get numerous errors
Any suggestions will be greatly appreciated. Thanks!
There is nothing really we can do on the library side to support unsupported old versions of TypeScript.
As an idea is try using npm-force-resolutions module to force new version of TypeScript.
Steps:
@pnp/sp, install resolutions package and TypeScript with an explicit version:npm i -D npm-force-resolutions [email protected]
package.json to a corresponding code blocks:{
"scripts": {
"preinstall": "npx npm-force-resolutions"
},
"resolutions": {
"typescript": "3.6.4"
}
}
npm install to trigger preinstall script and bumping TypeScript version into package-lock.jsonnpm run build, should produce no errorsIt's a viable option, let me add these notes into a docs article as well.
Andrew,
Thanks for the quick reply. That seems to have resolved my issue! Thank you so much, I have been banging my head against the wall since this started. One thing note; as soon as I got it to build and reinstalled office-ui-fabric-react the issue reemerged. I promptly uninstalled that and ran npm install and my project builds without a problem. So I will just forgo that package so I can use the awesome pnp/sp library! Thanks again for your help, amazing work.
Thanks,
James
Thanks @jduysen! Closing the issue.