1

I can not access getFolderByServerRelativeUrl() in pnp API.

await sp.web.getFolderByServerRelativeUrl()

Error:

Property 'getFolderByServerRelativeUrl' does not exist on type 'IWeb'.

2
  • Which version of PnP JS you are using? Nov 4, 2020 at 8:08
  • Thanks. I am using version 2.0.6. I am able to resolve it. Nov 4, 2020 at 8:18

1 Answer 1

1

I just change

import { sp } from "@pnp/sp";

to

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

Then it works.

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.