Theme CSS file is served from Virto Theme Assets instead of deployed theme files and breaks when asset is deleted

We are experiencing an issue with theme asset resolution in our Virto Commerce storefront.

Environment

  • Virto Commerce Storefront
  • Custom React Theme
  • Deployed via our standard deployment process

Issue

We have a stylesheet file:


/themes/assets/react-theme-style.scss.css

The file exists in our deployed theme code and is included in the deployment package.

Initially, the same file was also uploaded through the Theme Assets section in Virto Commerce. The storefront loaded correctly while the asset existed in the platform.

However, after deleting the asset from the Virto Commerce Theme Assets section, the storefront started showing the following browser error:


Refused to apply style from 'https://<store-url>/themes/assets/react-theme-style.scss.css'
because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled

Expected Behavior

If the file exists in the deployed theme code, we expect the storefront to serve the CSS file from the deployed theme and continue functioning even after the asset is removed from the Theme Assets section.

Actual Behavior

After deleting the asset from the platform:

  • The CSS request returns HTML instead of CSS.
  • The browser rejects the stylesheet due to MIME type mismatch.
  • The storefront styling is affected.

Which hosting and asset provider are you using now?

Able to resolve the issue
Thanks

Hi @NomanaReveation, thank you for the update

Could you provide more details about the solution? Maybe it helps somebody else.