Skip to content
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

master always reporting as 0 bytes, 0 sec, etc. #123

Open
mhuggins opened this issue Feb 21, 2025 · 1 comment
Open

master always reporting as 0 bytes, 0 sec, etc. #123

mhuggins opened this issue Feb 21, 2025 · 1 comment

Comments

@mhuggins
Copy link

mhuggins commented Feb 21, 2025

I just added the size-limit package and size-limit-action to our repo, and all new PRs are showing master as having a 0 byte size, 0 ms load/run time, etc.

Image

Our configuration is nothing crazy, there's not much room for error anywhere in here that I see.

.github/workflows/size-limit.yml:

name: size
on:
  pull_request:
    branches:
      - master
jobs:
  size:
    runs-on: ubuntu-latest
    env:
      CI_JOB_NUMBER: 1
      NODE_OPTIONS: "--max-old-space-size=4096"
    steps:
      - uses: actions/checkout@v2

      - uses: pnpm/action-setup@v4
        with:
          version: 9.8.0

      - uses: andresz1/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          directory: apps/platform
          package_manager: pnpm

package.json:

"scripts": {
  "build": "vite build",
  "size": "size-limit"
},
"size-limit": [
  {
    "limit": "1.25 MB",
    "path": "dist/assets/main-*.js"
  }
],

The GHA output shows that it's not calculating values of 0 for the PR branch or the master branch:

/usr/local/bin/npx size-limit --json
[
  {
    "name": "dist/assets/main-ByafeW4Z.js",
    "passed": true,
    "size": 718406,
    "sizeLimit": 1250000,
    "running": 0.14495333333333332,
    "loading": 14.0313671875
  }
]

[...SNIP...]

Previous HEAD position was 99f0b03 Merge 60224dbce07cb8d52a9581bea2c8e44d0561b8a1 into 941eb9fe475526a764a070a9238bc086099da0ff
Switched to a new branch 'master'
branch 'master' set up to track 'origin/master'.

[...SNIP...]

/usr/local/bin/npx size-limit --json
[
  {
    "name": "dist/assets/main-h8VYuD4J.js",
    "passed": true,
    "size": 658795,
    "sizeLimit": 1250000,
    "running": 0.1[179](https://github.com/XXX/XXX/actions/runs/13461514713/job/37617763814?pr=2633#step:4:180)7999999999999,
    "loading": 12.86708984375
  }
]

Is there something I've got configured wrong somewhere in here?

@mhuggins
Copy link
Author

I think this is fixed by adding a name field to my size-limit entry in my package.json. Testing that now.

"size-limit": [
  {
    "name": "main.js",
    "limit": "1.25 MB",
    "path": "dist/assets/main-*.js"
  }
],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant