1

I'm trying to use @pnp/sp with SPFx like shown on pnp GitHub page:

sp.web.select("Title").get().then(w => {
    console.log("title: " + w.Title);
});

When compiling the following TypeScript error is thrown: Property 'select' does not exist on type 'Web'

  • 1
    Which version of pnp js you are using? try installing it again using npm i @pnp/sp – Ganesh Sanap Oct 17 '19 at 7:18
1

try

import { sp, Web, IWeb } from "@pnp/sp/presets/all";

const web = await sp.web();
console.log(web.Title);
console.log(web.Id);

Be sure that you installed the correct libraries

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.