Comments (5)
I'm having the same issue although I'm upgrading to Django 3.2 from 3.1. I bumped the version from 0.7.0
to 1.6.0
and I'm getting the same error. Hopefully, we'll have something soon so we can upgrade. Thanks!
from django-webpack-loader.
+1 to this issue. It seems to be related to the fact that the new version of webpack-bundle-tracker
puts both the CSS and JS in the same array under one dictionary heading, as opposed to before where it was only one per. Hopefully it gets fixed soon, I'm moving to 1.5.0 for the time being and hoping for the best!
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.
from django-webpack-loader.
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 django-webpack-loader==1.6.0
and [email protected]
.
One thing I've noticed in the provided webpack-stats.json
file
{
"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 chunks
and status
as its keys, when the expected format for the stats file outputted by [email protected]
should be similar to
{
"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 chunks
, status
and also assets
. One thing to notice is that assets
on the file I've obtained is similar to chunks
on the provided file. If I recall correctly, that used to be the case in a previous version of webpack-bundle-tracker
, but was changed in favor of the new approach in a version prior to 1.6.0.
I've also did some investigations on webpack-bundle-tracker
to try pinpointing a section of the code that could be producing an incorrect stats file, but also couldn't identify it (for completeness, here is the section that produces the output content https://github.com/django-webpack/webpack-bundle-tracker/blob/master/lib/index.js#L146-L178).
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).
from django-webpack-loader.
It looks like this change https://github.com/django-webpack/django-webpack-loader/blame/master/webpack_loader/loader.py#L58 turned chunk["name"]
into chunk
so that it was passing a dict
into regex.match()
. This error is affecting me with django-webpack-loader==1.6.0
and [email protected]
.
When I switched to use 1.6.0
for both libraries, it started working correctly.
from django-webpack-loader.
Thanks for reporting back @Jdsleppy
Since version 1.0.0, both projects must always match versions in order to work correctly.
Therefore, if one uses django-webpack-loader==1.6.0
, they must use [email protected]
.
Even if something changes in only one side, we'll make a new release on the other.
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)
from django-webpack-loader.
Related Issues (20)
- Mixed content The page was loaded over HTTPS, but requested an insecure script 'http://0.0.0.0:8080/main.js'. This request has been blocked; the content must be served over HTTPS. HOT 3
- Refused to execute script from '..main.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. HOT 3
- Document better publicPath need for code splitting HOT 1
- get_files interface has changed HOT 1
- KeyError: 'status' when trying to `render_bundle` HOT 2
- Upgrading to Django 4.0 gives me "AttributeError: 'SafeString' object has no attribute 'get_bundle'" HOT 2
- Config.py enhancement please? HOT 4
- Need help with render_bundle after changing directory structure HOT 5
- STATIC_URL = '/static_dev/' is not respected HOT 1
- An proposal for a better `webpack_static` HOT 2
- Generated path in HTML not getting updated HOT 2
- Webpack loader blocks all requests silently if webpack-stats hangs at "compile" HOT 1
- Not loading image processed by webpack correctly HOT 7
- Problem with hot reload example on Node v18 LTS
- should FakeWebpackLoader also mock get_assets? HOT 1
- Support publicPath: "auto" HOT 2
- render _bundle error: TypeError: expected string or bytes-like object HOT 8
- I clone the simple app to my pycharm then install the dependency but get error when startup HOT 1
- `get_chunk_url` always uses `publicPath`, prevents cdn host. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-webpack-loader.