Shopify / Shopify/shopify-app-template-ruby
App won't load in production: MIME type error on redirect to auth on Heroku Docker deployment
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 154
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
I'm getting a MIME type error on the auth HTML file only in production (deployed to Heroku using Docker):
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
This is technically the index route that is getting redirected to auth. When holding down shift on the auth "script" file, we can see its initiator is a redirect from index.jsx:
Auth response preview:
It's definitely an HTML file:
Headers also indicate it's HTML:
But the app is expecting a JS module instead of an HTML file, and I'm not sure why - I guess because it's being redirected from index.jsx. This feels like an app config issue on auth redirects, but we didn't change any of the default configuration.
Note: app works fine in local development.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the redirect initiated by index.jsx and compare the auth asset response in local development with the Heroku Docker deployment. Inspect the production deployment configuration and response headers; done means the auth module request returns JavaScript with the correct MIME type and the app loads in production.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, javascript, ruby
- Domain
- authentication, devops, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100