-
Notifications
You must be signed in to change notification settings - Fork 346
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
Exception in Loader.filter_chunks due to wrong webpack-stats.json data format #324
Comments
I'm having the same issue although I'm upgrading to Django 3.2 from 3.1. I bumped the version from |
+1 to this issue. It seems to be related to the fact that the new version of EDIT: No luck on that, went all the way back to 1.1.0, still nothing. I am now attempting to include the filetype in the chunk name so that there is only one thing per chunk name. |
Hi folks, sorry to hear about this issue. I've tried to reproduce this behavior on my end, unfortunately I wasn't able to come across this issue on my attempts. I've used both One thing I've noticed in the provided {
"status": "done",
"chunks": {
"main": [
{
"name": "main.js",
"path": "/home/fabio/neuralmind/eliot/eliot/case_analysis/static/case_analysis/dist/main.js"
}
]
}
} is that the outer JSON only contains {
"status": "done",
"assets": {
"i-1561b91d7b75f3ca28145ff2b1a79802.png": {
"name": "i-1561b91d7b75f3ca28145ff2b1a79802.png",
"path": "/app/frontend/bundles/i-1561b91d7b75f3ca28145ff2b1a79802.png"
},
"i-4c677b78d12c96ea7adde99ce24d8172.png": {
"name": "i-4c677b78d12c96ea7adde99ce24d8172.png",
"path": "/app/frontend/bundles/i-4c677b78d12c96ea7adde99ce24d8172.png"
},
"main.js": {
"name": "main.js",
"path": "/app/frontend/bundles/main.js"
},
"vendors~main.js": {
"name": "vendors~main.js",
"path": "/app/frontend/bundles/vendors~main.js"
}
},
"chunks": {
"main": [
"vendors~main.js",
"main.js"
]
}
} with the outer JSON containing I've also did some investigations on I'll continue to investigate that behavior. In the meantime, could you double-check if both versions are running on 1.6.0 and, if possible, ensure that the stats file is being generated with the latest version(i.e.: delete any old stats file and ensure it's a new one being produced). |
It looks like this change https://github.com/django-webpack/django-webpack-loader/blame/master/webpack_loader/loader.py#L58 turned When I switched to use |
Thanks for reporting back @Jdsleppy I'll close this issue for now. If anyone is still facing the issue after correcting the versions, please let me know by commenting here and mentioning me. (cc @Starmism @ronilrufo-domain @fabiocapsouza) |
I'm updating a project to Django 4 and after updating both
django-webpack-loader
andwebpack-bundle-tracker
to 1.6.0 (migrating from v0.6.0), therender_bundle
tag is failing with a TypeError exception when loading CSS files.django-webpack-loader/webpack_loader/loader.py
Lines 54 to 63 in b9ac297
In
filter_chunks
,chunk
is expected to be a string but in my case it is a dict, so it raises TypeError when performingregex.match(chunk)
. In my case,chunks
is:The
webpack-stats.json
content is:My configs are:
webpack
version: 4.46.0Django template tag:
webpack.config.js
:settings.py
:I searched through READMEs and issues in both repositories but could not solve this issue, so any help will be appreciated.
Thanks in advance
The text was updated successfully, but these errors were encountered: