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

MIME type error for deployed online version, not locally #55

Open
Lootwig opened this issue Sep 30, 2022 · 6 comments
Open

MIME type error for deployed online version, not locally #55

Lootwig opened this issue Sep 30, 2022 · 6 comments
Labels
bug Something isn't working needs more info

Comments

@Lootwig
Copy link

Lootwig commented Sep 30, 2022

Even though running vite dev and also vite preview work locally, after deployment both chrome and safari aren't loading the JS due to this error (this is the chrome version, safari uses different wording):

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

I'm not sure whether this is due to a change in the adapter or in sveltekit.

This occurs with adapter version 0.9.1 and sveltekit build 504 - I tried downgrading to 0.9.0 and 477, but the behavior is the same (also, undoing all code changes done in the project since using these older versions does not make a difference).

@Lootwig
Copy link
Author

Lootwig commented Sep 30, 2022

I am able to reproduce this with a fresh npm create svelte@latest project, the only code change being that I am configuring the appengine adapter. Errors start coming up in the console when attempting to play the "wordle" game contained in the example app.

@Lootwig
Copy link
Author

Lootwig commented Sep 30, 2022

I also tried appending mime_type: application/javascript to the - url: /_app/immutable/ handler (to see if that would make ALL files receive the content-type: application/javascript header, even CSS stored in immutable) - this seems to have no effect at all

@HalfdanJ
Copy link
Owner

HalfdanJ commented Oct 9, 2022

I can see something broke on sep 29th https://github.com/HalfdanJ/svelte-adapter-appengine/actions/runs/3154256956, typically because something changed in sveltekit latest. Until I fix this, try and downgrade to sveltekit released before that date.

@HalfdanJ
Copy link
Owner

Hmm the test error was due to this issue. It was just because the test app had changed (#56), so going to need to debug this more.

@HalfdanJ
Copy link
Owner

@Lootwig I havent been able to reproduce this issue when deploying a vanilla example app from sveltekit (https://e2e-test-dot-svelte-demo-329602.uc.r.appspot.com/). Can you provide any additional details that can help me?

@AlexandruIstrate
Copy link

I'm also being affected by this issue

@HalfdanJ HalfdanJ added bug Something isn't working needs more info labels Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs more info
Projects
None yet
Development

No branches or pull requests

3 participants