Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!