Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
MIME type ('text/html') is not a supported stylesheet MIME type with react-django heroku deploy

I've been getting the error "MIME type ('text/html') is not a supported stylesheet MIME type" on my django+react deploy on Heroku. This is mostly because django can't find the staticfiles from react.

Setting staticfiles dir in settings.py should have solved the problem, but it didn't:

STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'

STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'build/static'),
)
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I decided to create this question with self answer because I spend a very long and frustrating afternoon solving this issue since I didn't find the right solution anywhere on the web.

What I did wrong in my deployment was setting my buildpacks the wrong way when I set up the project for heroku. Don't be me and immediately go to StackOverflow and find the solution there.

To serve the staticfiles correctly obviously python and collectstatic has to run after npm build from react. Thus add python buildpack after nodejs in Heroku:

heroku buildpacks:add --index 1 heroku/nodejs
heroku buildpacks:add --index 2 heroku/python
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda