svelte-adapter-appengine
svelte-adapter-appengine copied to clipboard
MIME type error for deployed online version, not locally
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).
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.
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
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.
Hmm the test error was due to this issue. It was just because the test app had changed (https://github.com/HalfdanJ/svelte-adapter-appengine/pull/56), so going to need to debug this more.
@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?
I'm also being affected by this issue