Code Monkey home page Code Monkey logo

Comments (5)

ronilrufo-domain avatar ronilrufo-domain commented on May 25, 2024

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.

Starmism avatar Starmism commented on May 25, 2024

+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.

rvlb avatar rvlb commented on May 25, 2024

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.

Jdsleppy avatar Jdsleppy commented on May 25, 2024

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.

fjsj avatar fjsj commented on May 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.