Sunday, 9 January 2022

Error: Module ‘@pnp/sp’ has no exported member ‘sp’

 

You may be using pnpjs v3.x 

Your code seems to be valid for v2.x, in v3.x there are changes (global "sp" object has been deprecated).

To install the previous version (v2.x) that is known to be compatible with the SPFx examples you seem to be using, try specifying the version explicitly:

npm uninstall @pnp/sp

then run below command

npm i @pnp/sp@2.11.0

No comments:

Post a Comment