web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Getting a server error...
Power Pages
Unanswered

Getting a server error code of 500 on portalbasictheme.css

(0) ShareShare
ReportReport
Posted on by 160

Hi all,

 

I seemed to have messed up the header on my site. It won't render properly when I go to preview, nor can I seem to apply a new style, it just goes back to the one I have. While it won't render properly, however, in the studio it looks fine.

 

When it is loading in preview in the browser, it throws a 500 error as follows:

KH_2437_0-1706458112305.png

 

KH_2437_1-1706458175190.png

Which is seems link back to the line below.

 

<link href="/portalbasictheme.css?1706457463606" rel="stylesheet"/> which is being called in the header below.

 

I checked the web files and portalbasictheme.css appears to be present.

 

Any help greatly appreciate to try and troubleshoot this down.

 

<!DOCTYPE html>
<html lang="en-US" data-lang="en-US" crm-lang="en-US" dir="ltr" crm-lcid="1033" same-site-mode="None">
 <head>
 <meta charset="utf-8"/>
 <meta name="viewport" content="width=device-width,&#32;initial-scale=1.0"/>
 <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
 <script type="text/javascript"></script>
 <title>Contacts

</title>
 <script src="/_resources/getresourcemanager?lang=en-US"></script>
 <script type="text/javascript">
 // Refresh all powerBI Iframes on Login in one Iframe
 window.addEventListener('message', function(event) {
 if (event && event.data && event.data == 'refreshPowerBI') {
 $("iframe.powerbi").each(function() {
 this.src=this.src;
 });
 }
 });

 // Fix for incorrect viewport width setting in IE 10 on Windows Phone 8.
 if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
 var msViewportStyle = document.createElement("style");
 msViewportStyle.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}"));
 document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
 }
 </script>
 <link href="/bootstrap.min.css?1706457463606" rel="stylesheet"/>
 <link href="https://content.powerapps.com/resource/powerappsportal/dist/font-awesome.bundle-3d8a58a48f.css" onerror="javascript&colon;&#32;var&#32;target&#32;=&#32;event.target;&#32;var&#32;link&#32;=&#32;document.createElement(&#39;link&#39;);&#32;link.crossOrigin&#32;=&#32;target.crossOrigin;&#32;link.href&#32;=&#32;&#39;/dist/font-awesome.bundle-3d8a58a48f.css&#39;;&#32;link.rel&#32;=&#32;&#39;stylesheet&#39;;&#32;target.insertAdjacentElement(&#39;afterend&#39;,link);" rel="stylesheet"/>
 <link href="https://content.powerapps.com/resource/powerappsportal/dist/preform.bundle-ed52eff176.css" onerror="javascript&colon;&#32;var&#32;target&#32;=&#32;event.target;&#32;var&#32;link&#32;=&#32;document.createElement(&#39;link&#39;);&#32;link.crossOrigin&#32;=&#32;target.crossOrigin;&#32;link.href&#32;=&#32;&#39;/dist/preform.bundle-ed52eff176.css&#39;;&#32;link.rel&#32;=&#32;&#39;stylesheet&#39;;&#32;target.insertAdjacentElement(&#39;afterend&#39;,link);" rel="stylesheet"/>
 <!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
 <!--[if lt IE 10]>
<script src="~/js/formdata.js"></script>
<![endif]-->
 <link href="/thumbnail.css?1706457463606" rel="stylesheet"/>
 <link href="/theme.css?1706457463606" rel="stylesheet"/>
 <link href="/portalbasictheme.css?1706457463606" rel="stylesheet"/>
 <link href="https://content.powerapps.com/resource/powerappsportal/dist/pwa-style.bundle-2739c60227.css" onerror="javascript&colon;&#32;var&#32;target&#32;=&#32;event.target;&#32;var&#32;link&#32;=&#32;document.createElement(&#39;link&#39;);&#32;link.crossOrigin&#32;=&#32;target.crossOrigin;&#32;link.href&#32;=&#32;&#39;/dist/pwa-style.bundle-2739c60227.css&#39;;&#32;link.rel&#32;=&#32;&#39;stylesheet&#39;;&#32;target.insertAdjacentElement(&#39;afterend&#39;,link);" rel="stylesheet"/>
 </head>

 

 

KH_2437_2-1706458407153.png

 

Categories:
I have the same question (0)
  • Peragin Profile Picture
    160 on at

    I fired up another site and compared the loading of the home page and can see a difference.

     

    Successful load:

    KH_2437_0-1706479211263.png

    Unsuccessful load:

    KH_2437_1-1706479308727.png

    I can see the portalbasictheme.css in the code editor but do I have to upload it in a certain way to web files, or do I have to change some setting after I upload it?

  • talonx32 Profile Picture
    8 on at

    Hi. I'm having the same issues in my development portal. I modified the style and it work fine but when I preview the page I received the 500 error. I never touch the css file so I' not sure what happened.

  • Lucas001 Profile Picture
    2,434 Super User 2025 Season 2 on at

    Hi @KH_2437,

     

    could you save your current header somewhere in a document and copy paste the defualt header of another page into the one facing the issue?

    If the problem is resolved the adjusted header seems to be the problem. If it does not solve the issue there is a problem somewhere in the backend and I would suggest raising a ticket to microsoft.

  • Peragin Profile Picture
    160 on at

    Thanks for the response. I tried this but no joy. I had to restore my environment from a restore point. But the restore failed. Ticket open with MS to resolve this. Probably a good idea to export the site regularly and certainly backup production (export) before releasing an update.

  • Jady Profile Picture
    147 on at

    Portalbasictheme.css is modified by Power Pages Editor when you make any changes under the "Styling" tab, for example changing your color palette or modifying your font styles. It generates a new Portalbasictheme.css. 

    Perhaps you could try modifying one of the attributes under your Styling tab, click save, sync & preview, and check again if the file is still missing. 

    If it is still missing, perhaps there's some obscure Portal Management setting that is disabling it? There are many settings that are not well documented: 
    https://github.com/OOlashyn/PowerAppsPortalSiteSettingsAndSnippets
    ...although nothing in that list for disabling Portalbasictheme 😞

  • Fubar Profile Picture
    8,379 Super User 2025 Season 2 on at

    not sure if you tried it or not but did you try explicitly setting the type onthe link tag, (if type is not set the browser is meant to then use the value in the rel attribute to work out what it should be)

    <link rel="stylesheet" type="text/css" href="xxxxxxxxxxx">

     

  • talonx32 Profile Picture
    8 on at

    I wanted to give an update on this. After stepping away I started making sure the HTTP/X-Content-Type-Options and Content security policy was setup properly then I started receiving the message "The error "Refused to apply style from 'URL' because its MIME type ('text/html') is not a supported stylesheet MIME type". I then deactivated the HTTP/X-Content-Type-Options and reactivated it. I decided to go back to the style sheet settings and change the primary button color and save/sync. Preview and it worked! Still not sure what really happened but it seems like it was between the style sheet configuration/site setting and syncing.

  • Peragin Profile Picture
    160 on at

    Thanks everyone for your responses. I finally got it back. MS fixed the restore and it went through. However, then my site wouldn't render at all. Just wouldn't load after I synced and did preview. I updated the style by adding a color and that got the site to fire. Then it gave me an Access Denied 403 error. This was 6 hours after MS said it should be available again. In desperation, I updated the Web Key in the admin centre and it came back soon after. I have no idea if that made any difference or was there some background routine that happen to finish at the same time.

     

    During my research, it appears that copying environments breaks sites. MS advised me that I should have restored to a separate site and then copied to my dev environment to restore it. Lucky I didn't, it appears.

     

    Thanks again

  • Peragin Profile Picture
    160 on at

    I tried that as well, the thing is, the site couldn't see it. I tried the css path directly in the browser and it wasn't found so I don't know what it was.

  • Peragin Profile Picture
    160 on at

    I tried that as well but no joy. Yes, I should probably have raised a ticket with MS. It would have been faster than the failed restore. Thanks for your response.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 89 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard