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
D5
D5OP10mo ago
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
Cyb3r-Jak3
Cyb3r-Jak310mo ago
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
D5
D5OP10mo ago
Yes, I direct uploaded. With both chrome and firefox. Tried too on incognito mode and no luck
Cyb3r-Jak3
Cyb3r-Jak310mo ago
Can you try using wrangler to do the upload and see if that works.
D5
D5OP10mo ago
Yes, will try, one second Done. No luck Same error is being shown
Cyb3r-Jak3
Cyb3r-Jak310mo ago
I’d file an issue on the wrangler repo because it seems like the file mimetype isn’t being correctly parsed.
D5
D5OP10mo ago
Shall I create it?
Cyb3r-Jak3
Cyb3r-Jak310mo ago
Yeah sorry you should file the issue and if you have a minimal recreate then it will help the team debug
D5
D5OP10mo ago
But if the same happens with both manual and wrangler, then I think it's not wrangler specific?
Cyb3r-Jak3
Cyb3r-Jak310mo ago
I don’t know what the manual upload process does but I suspect it’s parsed similarly to how wrangler does
D5
D5OP10mo ago
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...
D5
D5OP10mo ago
Thanks a lot! @Cyb3r-Jok3
Want results from more Discord servers?
Add your server