Exception Value: string indices must be integers : Render bundle error vue + django
I had the same issue in the great Udemy course The Complete Guide to Django REST Framework and Vue JS. You probably cannot read the answer from Michele Saba if you are not subscribed.
It probably has something to do with the package versions and them being alpha. Downgrading to
- [email protected]
- django-webpack-loader==0.7.0
worked for me. Downgrade using:
npm install --save-dev [email protected]
Downgrade Webpack-bundle-tracker as told by @Frans
npm install --save-dev [email protected]
In vue.config.js
config
.plugin('BundleTracker')
.use(BundleTracker, [{filename: './webpack-stats.json'}])
Then delete the dist
folder with the old webpack-stats.json
In this version and with this config webpack-stats.json
file is generated in frontend
not in frontend/dist
So you must change STATS_FILE
in settings.py
(for example if your Vue project is frontend
)
'STATS_FILE': os.path.join(BASE_DIR, 'frontend','webpack-stats.json'),
Then restart Vue and Django web-servers.