Forum Discussion

anirudhaditya's avatar
anirudhaditya
Copper Contributor
Jul 16, 2022

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/sites/Site-Dev/_layouts/15/_api/web/getList('News')/views/getByTitle('Default')?$select=ViewQuery

 

but if I remove _layouts/15 it works well on the browser and i am able to get the return on the browser. 

 

Now how to get the code fixed then?

 

sp/pnp@2.12.0

 

Thanks

Aniruddha

Resources