Post Purchase Extension not rendering

GeniusWave
Shopify Partner
11 0 2

I'm having this error on my console while trying to preview my Post Purchase Extension that I can't understand :

 

Refused to apply style from 'https://testingstore-geniuswave.myshopify.com/private_access_tokens?id=e42226b6f1687160fb3a07e6b80a5...' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Reply 1 (1)
Liam
Shopify Staff
Shopify Staff
1882 202 577

Hi GeniusWave,

 

This error usually occurs when the server responds with the wrong MIME type (in your case 'text/html') for a CSS file. The server should respond with 'text/css' for CSS files.

There a couple reasons why this might be happening:

  1. The URL you're trying to access is incorrect and returning an HTML 404 page of your CSS file.
  2. There's an issue with the access token you're using.
  3. You're trying to load a CSS file from a non-Shopify CDN source,

Here's how you can troubleshoot the problem:

  • Double-check the URL of your CSS file to make sure it's correct.
  • Ensure the access token you're using is valid and has the necessary permissions.
  • If you're hosting your CSS file outside, try uploading it to Shopify's CDN.

Try the above and let us know if you're still seeing issues. Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog