Getting mime error: content type is [''] with flutter
My flutter app doesn't loads and throws mime error. Apparently cloudflare pages is not detecting my main.dart.js script and returning it as plain text/without the content type header.
I tried:
1. Disabling cache
2. Disable proxying for the custom domain
3. Redeploying
4. Purging cache
5. Disabling minify
6. Deploying through chrome and through firefox
Nothing works, and the issue persist
12 Replies
Note: flutter doesn't have any kind of SSR, so that's not an issue
Note 2: Works perfectly on netlify and similar services, only happens with cloudflare pages
Even proxied through cloudflare
Did you direct upload? There’s a weird bug where sometimes the mime type doesn’t get set correctly on direct upload sometimes. If you use wrangler then it should be fine
Yes, I direct uploaded. With both chrome and firefox. Tried too on incognito mode and no luck
Can you try using wrangler to do the upload and see if that works.
Yes, will try, one second
Done. No luck
Same error is being shown
I’d file an issue on the wrangler repo because it seems like the file mimetype isn’t being correctly parsed.
Shall I create it?
Yeah sorry you should file the issue and if you have a minimal recreate then it will help the team debug
But if the same happens with both manual and wrangler, then I think it's not wrangler specific?
I don’t know what the manual upload process does but I suspect it’s parsed similarly to how wrangler does
GitHub
Getting mime error [''] · Issue #234 · cloudflare/wrangler-action
When deploying a flutter app, I get mime error for the main.dart.js file. It happens with both the wrangler and manual deployment, in different browsers. I tried disabling cache, redeploying... Not...
Thanks a lot! @Cyb3r-Jok3