Django, Webpack and Heroku: Error reading /app/webpack-stats.json

136 Views Asked by At

I'm trying to use Django with Webpack on Heroku via django-webpack-loader. After pushing the files from the repository to Heroku, I run webpack to generate the static files in /dist as well as webpack-stats.json:

npx webpack --config webpack.config.js

This works fine: both the /dist files and the webpack-stats.json file are correctly created (both are placed within /app/). However, when I try to load the page I get an error:

OSError at /
Error reading /app/webpack-stats.json. Are you sure webpack has generated the file and the path is correct?

The error doensn't say much other than the file /app/webpack-stats.json is missing; however, the file exists, its content is well-formatted and it's in the right location.

0

There are 0 best solutions below