Issue Creating "Modern" Site Pages
With the addition of some SharePoint Framework only web parts, namely the Power BI web part (currently in preview). My coworkers and myself find ourselves playing with the Modern Site pages more often. As with all new things, we find new issues.
So when trying to add a modern site page to an existing site, we found ourselves in an interesting situation. The option for site pages wasn't even there.
Now we know we have it enabled as we're able to create modern site pages without issue in other site collections, and even sibling subsites. So at first I thought it was a missing content type. Adding the content type of "site pages" to the library did cause the item to show. But once you make one, you'd get this error.
When comparing the broken site with the working site, we found that they had identical features activated.
Although the two sites (the subsite where site pages works, and the one with site pages missing) have the same features activated. Not all features will show when looking at the web interface. So let's connect with PowerShell to dig a little deeper. For this we'll need the SharePoint Online Management shell. Which can be downloaded here.
Connecting to our SharePoint Online site is pretty straight forward. You can pass the credentials directly in if you want, but I prefer to use the "-UseWebLogin" option. This option also allows you to connect when you have two factor turned on.
Now that we are connected, we can simply just run "Get-SPOFeature" which will give us a list of all features activated on this website. If we wanted to view the site connection, we'd just simply add "-Scope site" as an option. But since our two sub sites sit in the same collection, we know it's a website scoped feature.
Ran this on both sites and got the below output. Right away we see something is wrong, as they are different lengths.
Copying the results into Excel make them much easier to deal with. Now we can see what the issue is. Even tho they seem to have the same features activated when looking at the web interface. With powerShell we see they aren't actually identical. Looking at the second one on the list, we see our issue.
Now that we know which ones are missing, we can run some quick PowerShell to manually activate these features.
Now not only does the item show, but you can actually create one!