Error while calling sphttpclient SPFX extension
Just following the SP starter kit code for adding the footer menu. This error is occurring in SPTaxonomyService and SPUserProfileService.
Category
- [x] Question
- [ ] Typo
- [x] Bug
- [ ] Additional article idea
Observed Behavior
[21:27:31] Error - typescript - src\services\SPTaxonomyService.ts(46,13): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((url: string, configuration: SPHttpClientConfiguration, options: ISPHttpClientOptions) => Promis...' has no compatible call signatures.
Package.json
{ "name": "footer", "version": "0.0.1", "private": true, "engines": { "node": ">=0.10.0" }, "scripts": { "build": "gulp bundle", "build:dev": "gulp clean && gulp bundle && gulp package-solution", "build:prod": "gulp clean && gulp bundle --ship && gulp package-solution --ship", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/decorators": "1.5.0", "@microsoft/sp-application-base": "1.5.0", "@microsoft/sp-core-library": "1.5.0", "@microsoft/sp-dialog": "1.5.0", "@microsoft/sp-office-ui-fabric-core": "^1.5.1", "@microsoft/sp-webpart-base": "~1.4.1", "@pnp/common": "^1.0.4-4", "@pnp/logging": "^1.0.4-4", "@pnp/odata": "^1.0.4-4", "@pnp/sp": "^1.1.4", "@pnp/spfx-controls-react": "1.4.0", "@pnp/spfx-property-controls": "1.7.0", "@types/react": "15.6.6", "@types/react-dom": "15.5.6", "@types/es6-promise": "0.0.33", "@types/webpack-env": "1.13.1", "office-ui-fabric-core": "^9.6.0", "react": "15.6.2", "react-dom": "15.6.2", "@microsoft/sp-listview-extensibility": "~1.4.1" }, "devDependencies": { "@microsoft/sp-build-web": "1.5.0", "@microsoft/sp-module-interfaces": "1.5.0", "@microsoft/sp-webpart-workbench": "1.5.0", "gulp": "~3.9.1", "@types/chai": "3.4.34", "@types/mocha": "2.2.38", "ajv": "~5.2.2" } }
First, ensure that all your @microsoft/sp-??? dependencies are on the same version. You have a mix of 1.4.1, 1.5.0 and 1.5.1. Then remove the node_modules folder and package-lock.json and run npm install.
Wictor,
Will do the changes and let you know
On Fri 24 Aug, 2018, 1:10 AM Wictor Wilén, [email protected] wrote:
First, ensure that all your @microsoft/sp-??? dependencies are on the same version. You have a mix of 1.4.1, 1.5.0 and 1.5.1. Then remove the node_modules folder and package-lock.json and run npm install.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SharePoint/sp-dev-docs/issues/2408#issuecomment-415545913, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae2rzTxVJwC19PqRWaQG-MYjZPILnJGFks5uTwUcgaJpZM4WJ1Pg .
I have updated the to correct versions now I am getting a different error.
here is my package.json
{ "name": "share-point-portal-showcase", "version": "0.0.1", "private": true, "engines": { "node": ">=0.10.0" }, "scripts": { "build": "gulp bundle", "build:dev": "gulp clean && gulp bundle && gulp package-solution", "build:prod": "gulp clean && gulp bundle --ship && gulp package-solution --ship", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/decorators": "~1.4.1", "@microsoft/sp-application-base": "~1.4.1", "@microsoft/sp-core-library": "~1.4.1", "@microsoft/sp-dialog": "~1.4.1", "@microsoft/sp-lodash-subset": "~1.4.1", "@microsoft/sp-office-ui-fabric-core": "~1.4.1", "@microsoft/sp-webpart-base": "~1.4.1", "@pnp/common": "^1.0.4-4", "@pnp/logging": "^1.0.4-4", "@pnp/odata": "^1.0.4-4", "@pnp/sp": "^1.0.4-4", "@pnp/spfx-controls-react": "1.4.0", "@pnp/spfx-property-controls": "1.7.0", "@types/react": "15.6.6", "@types/react-dom": "15.5.6", "@types/webpack-env": ">=1.12.1 <1.14.0", "react": "15.6.2", "react-dom": "15.6.2", "@microsoft/sp-listview-extensibility": "~1.4.1" }, "devDependencies": { "@microsoft/sp-build-web": "~1.4.1", "@microsoft/sp-module-interfaces": "~1.4.1", "@microsoft/sp-webpart-workbench": "~1.4.1", "@types/chai": ">=3.4.34 <3.6.0", "@types/mocha": ">=2.2.33 <2.6.0", "ajv": "~5.2.2", "gulp": "~3.9.1" } }
tsconfig.json
{ "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "commonjs", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "es6-promise", "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection" ] } }

After updating your dependency versions in package.json, have you deleted the node_modules folder and re-run npm install?
Yes I did.
On Sat 25 Aug, 2018, 4:52 PM Waldek Mastykarz, [email protected] wrote:
After updating your dependency versions in package.json, have you deleted the node_modules folder and re-run npm install?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SharePoint/sp-dev-docs/issues/2408#issuecomment-415962627, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae2rzUEQMcqqv1AvDTeirg2vsR6uL6TXks5uUTOCgaJpZM4WJ1Pg .
If you create a new project and move your code there, can you reproduce the error?
Just to provide some feedback as I got this error yesterday and resolved it using the same steps as suggested on this thread. @Shamrh did you try the steps above to update your dependencies and re-install the entire node_modules folder?
What also helps is to run npm dedupe which prevents you from having to remove the node_modules folder and the lock file.
Added labels to prompt for follow up, or to close stale issue.
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.
Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.
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