let list= sp.web.lists.getByTitle("News") 404

Occasional Contributor

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('...

 

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

0 Replies