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
  • 1
    Which version of pnp js you are using? try installing it again using npm i @pnp/sp Oct 17, 2019 at 7:18

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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