Forum Discussion
anirudhaditya
Jul 16, 2022Copper Contributor
let list= sp.web.lists.getByTitle("News") 404
Hi, Not sure what is going wrong but let list= sp.web.lists.getByTitle("News") always throws 404 error. Checking the log the Uri it tries to hit seems wrong https://Tenant.sharepoint.com/sit...
Parthiban_Balraj
Apr 21, 2023Copper Contributor
Got the same issue. did you find a solution?
- ganeshsanapApr 22, 2023MVP
Parthiban_Balraj anirudhaditya,
You have to supply web part context to PnP JS library while using it within SPFx. Check below threads for more information (Use which works for you based on version of PnP JS library you are using):
- Web-Part works on localhost, but it does not working on SPO
- Can someone please explain what the block of code below is used for in SPFX
- Facing Error Implementing CRUD operations using spfi pnpjs package
- Using @pnp/sp spfi factory interface in SPFx
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs