-
Notifications
You must be signed in to change notification settings - Fork 44
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
App won't load in production: MIME type error on redirect to auth on Heroku Docker deployment #155
Comments
We found the root cause of the issue - if you use Docker in Heroku, then the environment variables aren't available at build time: https://devcenter.heroku.com/articles/build-docker-images-heroku-yml#set-build-time-environment-variables We're getting around it right now by hard-coding the values of |
We're getting around it right now by hard-coding the values of Shopify documentation already mentioned you can need to add What does your
# heroku.yml
build:
docker:
web: Dockerfile
config:
SHOPIFY_API_KEY: <YOUR_SHOPIFY_API_KEY> |
I meant this literally:
|
I'm sorry if misunderstood.
|
Yes, I understood you the first time. I was just answering your question. It's still not ideal though - it's just saved in a different file that is still available in the repo. |
Yes. You are right. |
I'm getting a MIME type error on the auth HTML file only in production (deployed to Heroku using Docker):
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:
![Image](https://private-user-images.githubusercontent.com/4777393/408300869-3400557c-0b16-4855-b430-7a61ebf16f06.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTE3MTMsIm5iZiI6MTczOTI5MTQxMywicGF0aCI6Ii80Nzc3MzkzLzQwODMwMDg2OS0zNDAwNTU3Yy0wYjE2LTQ4NTUtYjQzMC03YTYxZWJmMTZmMDYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTYzMDEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MWFlZTI0YmYxNjNmNmUzZmVjN2M3ZDIyNDMzMWE0YWVlNDc4OTA0ZDZlOGNmMjI0MTllMGQzMTdmNjk1OWQ1ZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.tIBINM0cAVRzvv6GW8v0pQhLcidqy5au-M9bbkH6WJI)
It's definitely an HTML file:
![Image](https://private-user-images.githubusercontent.com/4777393/408301116-1f17e463-b0dc-446d-8a07-42d6b899fc7b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTE3MTMsIm5iZiI6MTczOTI5MTQxMywicGF0aCI6Ii80Nzc3MzkzLzQwODMwMTExNi0xZjE3ZTQ2My1iMGRjLTQ0NmQtOGEwNy00MmQ2Yjg5OWZjN2IucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTYzMDEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGVkMzRhNzViMzBhNjQ2M2U5OGJiZGM4ZjQ1YTBhNDU2MjA3YzkwMjk0NTQzZjJhNjc3ZWY1MWUzZjg5YzNiZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.tmMSBKawp_Op00f8cglJ0ZZrKVArpDgsRPWpzWze-Ik)
Headers also indicate it's HTML:
![Image](https://private-user-images.githubusercontent.com/4777393/408302223-20937226-2af5-4165-8f3e-bf96eed29580.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTE3MTMsIm5iZiI6MTczOTI5MTQxMywicGF0aCI6Ii80Nzc3MzkzLzQwODMwMjIyMy0yMDkzNzIyNi0yYWY1LTQxNjUtOGYzZS1iZjk2ZWVkMjk1ODAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTYzMDEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmQyNTZhMWJkNzY0ZjU4MDNlNTQ1ZDlmYzJlNWUyYWNjNDQ2MGIxZTM3NDIwOTA3MjcxZTdmZWNlMDI0NWMwZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.9jx491x7hefG5dcjwdx3B0gYDlvzqtWlOGe6S6Agp7s)
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.
The text was updated successfully, but these errors were encountered: