Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 404 on loading js lang file - MIME type ("text/html") i.o (javascript) #384

Closed
Xelaflash opened this issue Nov 26, 2019 · 7 comments
Closed

Comments

@Xelaflash
Copy link

Xelaflash commented Nov 26, 2019

Hi,

I've got an 404 error in the console for the lang file(s).

Error states : The script from “xxx.com/tarteaucitron/lang/tarteaucitron.fr.js?v=20191031” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.

and

Loading failed for the <script> with source “xxx.com/tarteaucitron/lang/tarteaucitron.fr.js?v=20191031”.

When checking the network tab i can see the response headers / content-type set to text/html preventing the script to load.

Screenshot 2019-11-26 at 16 02 06

I have this issue only on production (site deployed to netlify).
In dev all is working well i have Content-type: application/javascriptas Response header.

Do you have any idea of where this issue lies and how to solve this out?

Thanks in advance.

@fsoabsix
Copy link

Hi, i have the same problem ...

@inwardmovement
Copy link

Same here, any insight @AmauriC?

@AmauriC
Copy link
Owner

AmauriC commented Jun 4, 2020

The mime type is managed by your servers, it's not setted by the script itself 🧐

Or I miss something? Someone as a live example?

@inwardmovement
Copy link

I have an example here: https://algosphere.org/

image

@AmauriC
Copy link
Owner

AmauriC commented Jun 4, 2020

No adblocker on your browser? With Chrome/Mac GA is correctly loaded.

@inwardmovement
Copy link

Indeed it works when the adblocker is disabled. Can you do something to get around adblockers?

Also, I've got this message:
Le cookie « _ga » sera bientôt rejeté car son attribut « sameSite » est défini sur « none » ou une valeur invalide, et sans attribut « secure ». Pour en savoir plus sur l’attribut « sameSite », consultez https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

Can you add SameSite=Lax to the cookie, or is it Google who has to take care of this?

@AmauriC
Copy link
Owner

AmauriC commented Jun 5, 2020

No, this is not possible to bypass an adblocker but there is an option to show a message if an adblocker is detected:
"adblocker": true,

Open a new issue for the cookie, I'll check ; )

@AmauriC AmauriC closed this as completed Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants