django-webpack / webpack-bundle-tracker

Spits out some stats about webpack compilation process to a file
MIT License
268 stars 107 forks source link

Missing assets section of webpack-stats in ci github action agent build #124

Closed roblatdomain closed 8 months ago

roblatdomain commented 8 months ago

Issue description

In local build, webpack-stats is good, it looks like:

...
"assets": 
    "offers-928c50a.js": {
      "name": "offers-928c50a.js",
      "path": "[hidden]/static/bundles/offers-928c50a.js",
      "publicPath": "/static/bundles/offers-928c50a.js"
    },
...
"chunks": {
    "offers": [
      "offers-928c50a.js"
    ],
}

But in ci build, it looks like:

... // assets section missing
"chunks": {
    "offers": [
      {
        "name": "offers-928c50a.js",
        "publicPath": "/static/bundles/offers-928c50a.js",
        "path": "[hidden]/static/bundles/offers-928c50a.js"
      }
    ],
}

Then in ci tests will emit many weird errors: TypeError: expected string or bytes-like object. My question is what can make that difference?

Technical info

 Binaries:
    Node: 14.17.3 - /usr/local/bin/node
    Yarn: 1.22.21 - /usr/local/bin/yarn
    npm: 6.14.13 - /usr/local/bin/npm
  npmPackages:
    uglifyjs-webpack-plugin: ^2.2.0 => 2.2.0 
    webpack: 5.58.0 => 5.58.0 
    webpack-bundle-tracker: 2.0.1 => 2.0.1 
    webpack-cli: 4.9.0 => 4.9.0 
fjsj commented 8 months ago

Where in CI build are you seeing the second case?

roblatdomain commented 8 months ago

Where in CI build are you seeing the second case?

Our ci pipeline will run yarn build and generate webpack-stats.json as a part of artifact for download from github: https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts. I found the second case in there.

roblatdomain commented 8 months ago

I figured out the reason, there is a actions/cache@v3 in our pipeline caused that.