Sharepoint: List ‘Site Pages’ does not exist at site

Sharepoint: List ‘Site Pages’ does not exist at site

I recently got this error from Sharepoint Online, when trying to fetch a site’s list using

List 'Site Pages' does not exist at site with URL

The code resulting in the error was this:

import { Web } from "@pnp/sp/webs";
const siteUrl = ""
let web: any = Web(siteUrl);
let pages: any = await web.lists.getByTitle("Site Pages")"Title").getAll();

After spending (too much) time troubleshooting this, it turned out to be a language settings mismatch: The site I was connect to was set up with Norwegian as the default language, which means that the list isn’t called “Site Pages” but rather “Områdesider”. So apparently, when fetching lists from sites you must account for site’s language settings. I found this to be pretty non-intuitive, as language settings to me typically is something that affects the end user, not something that affects how on programatically connects to a service.

Anyways, just though I’d share this just in case others come across the same issue.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: