Script load baseUrl internally returning Refused to execute script from 'https://staging.go.tallyfy.com' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled

We have an angularJs app in CF pages and there’s 2 domain for staging and for production.

We use 1 of the preview branches for our live staging (staging branch) and production for live our production site. We are not using Custom Domain since some of our assets is not served in CF pages.

We use CF worker to load all of our assets (angularJs app build in CF pages and some image assets in Cloudfront).

We have an issue regarding script tag (our js bundle) load/call our baseUrl inside the script and it is throwing error due to mime-type is incorrect (baseUrl is text/html).

This is the message that thrown from browser console

Refused to execute script from ‘https://staging.go.tallyfy.com’ because its MIME type (‘application/json’) is not executable, and strict MIME type checking is enabled.

Not sure why it’s call the base-url (there’s no issue like this before).

Is this issue related to the worker (redirect response issue) or from our internal script?

Thanks

1 Like

Is this coincidence, or does this belong to @tallyfy?

1 Like

It does indeed - @adheegm is one of our super-heroes!

1 Like

I’ve only seen this when I get some sort of error message instead of the actual resource. If you click on “Response” in Dev Tools, it should show you what’s actually being returned.

This has been fixed. The issue is from our worker code itself. Thanks for the time and checking this @sdayman

1 Like