react-application-injectcss icon indicating copy to clipboard operation
react-application-injectcss copied to clipboard

Unable to load css

Open tony-philipose opened this issue 3 years ago • 3 comments

First, I have added the custom app to the site contents, the styles become loaded successfully, then remove the app from the site contents of a particular site and then re-install it, but the CSS is not loading??

tony-philipose avatar Jul 02 '21 11:07 tony-philipose

@tony-philipose can you take a look if there are any error messages in your browser's developer console?

hugoabernier avatar Jul 02 '21 17:07 hugoabernier

I have the same issue and the error in the browser console was the following:

Refused to apply style from 'https://tenant.sharepoint.com/Style%20Library/custom.css' because its MIME type ('') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Is there a way to fix this?

mcxycross avatar Aug 12 '22 05:08 mcxycross

The path of your CSS file seems to be incorrect. By default it's $customCSSUrl = "/Style%20Library/custom.css" You should modify the value of $customCSSUrl by the location of your custom.css.

If your custom.css file is host on a site, then, $customCSSUrl = /sites/{your-site-name}/Style%20Library/custom.css

Hope it will help somebody.

arthur469 avatar Jul 19 '23 15:07 arthur469