Skip to content

mime type change critical crash #746

Description

@Bader-Idris

🐛 The bug

I've flipping my app for an entire week searching for the reason, thanks to firefox browser it showed up, I use google analytics and google tag manager in my nuxt 4.4.4 app with nuxt script 1.0.6, this is my scripts object in nuxt config file:

scripts: {registry: {googleAnalytics: {id: process.env.GOOGLE_ANALYTICS_MEASUREMENT_ID,trigger: 'onNuxtReady'},googleTagManager: {id: process.env.GOOGLE_TAG_MANAGER_ID,trigger: 'onNuxtReady'},},},// after updating them from boolean value

the browser in dev says:

The script from “http://localhost:3000/_scripts/assets/298b21fc6f49a22c.js?id=G-59KJGZ93M6” was loaded even though its MIME type (“”) is not a valid JavaScript MIME type. [localhost:3000](http://localhost:3000/)
The script from “http://localhost:3000/_scripts/assets/5a3181dffd17faad.js?id=GTM-W8TCSQDL” was loaded even though its MIME type (“”) is not a valid JavaScript MIME type.

and in production it is a nightmare, we can't log anything there, browsers crash the whole app due to misbehaviour detection, js instead of json!

🛠️ To reproduce

https://baderidris.com/

🌈 Expected behavior

mime types are sensitive in browsers, please make sure your modifications to 3rd parties meet with expected types

ℹ️ Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions