Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/css"

This issue has been tracked since 2023-02-11.

Version

"@nuxtjs/tailwindcss": "^6.4.0",
"nuxt": "^3.1.2"

Reproduction Link

https://www.loom.com/share/f33768c4ef004531967e4d69780313cf

Steps to reproduce

  1. Install the latest nuxt.
  2. Install @nuxtjs/tailwindcss with the minimal setup.
  3. Add some basic tailwind helper classes to some element.
  4. Start localhost.

What is Expected?

  • Styles should render on screen.

What is actually happening?

  • Styles don't get rendered.
  • I am getting this error when loading the page:
    Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/css". Strict MIME type checking is enforced for module scripts per HTML spec.

Error disappears if I hard-reload and re appears next time I load the page again.

References

  • #387
    None of the solutions mentioned here have worked for me.
bbroekhuizen wrote this answer on 2023-02-27

@nachoadjust I have the same issue, but it seems to work in FireFox and Safari. But not in Chrome. Also weirdly enough it works for me in incognito mode.

  • Can you try it in FireFox, Safari and Chrome incognito mode?
  • Can you check if your extensions are disabled in Chrome, maybe something is conflicting there.
nachoadjust wrote this answer on 2023-02-27

@bbroekhuizen you are correct.

If browser is Safari, FFox or Chrome Incognito it works well.

If browser is Chrome + NOT incognito it fails.

Sidenotes:
For chrome:
I disabled all chrome plugins I have installed as you mentioned (adblocker, Analytics, etc) in a wild hope that they might be influencing somehow, but it didn't had any effect.

Video:
https://www.loom.com/share/e232033f2ca342c88703e02a0bb19088

Thanks for the help!!!

More Details About Repo
Owner Name nuxt-modules
Repo Name tailwindcss
Full Name nuxt-modules/tailwindcss
Language TypeScript
Created Date 2019-04-04
Updated Date 2023-03-29
Star Count 1285
Watcher Count 12
Fork Count 157
Issue Count 57

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date