0

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? – Ganesh Sanap Nov 4 '20 at 8:08
  • Thanks. I am using version 2.0.6. I am able to resolve it. – Md. Nizam Uddin Mahmud Nov 4 '20 at 8:18
0

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.