bundlesize icon indicating copy to clipboard operation
bundlesize copied to clipboard

(-null) appearing in PR checks sometimes

Open carly-litchfield-zocdoc opened this issue 6 years ago • 7 comments

Do you want to request a feature or report a bug? Bug

What is the current behavior? Sometimes in PR status's, I see (-null) in the bundlesize checks. Sometimes it's perfectly fine. When there is (-null) in the check, the link doesn't display any data under the master section. See screenshots below.

Working image Clicking link: image

Not Working image Clicking Link: image

If the current behavior is a bug, please provide the steps to reproduce. I'm unfortunately not sure what causes it to display null sometimes and no change other times.

What is the expected behavior? It always says no change instead of -null

Please mention other relevant information.

  • node version: 8.4.0
  • npm version: 6.0.1
  • Operating system: Linux
  • bundlesize version: 0.17.0
  • CI you are using: Travis

carly-litchfield-zocdoc avatar Jun 06 '18 15:06 carly-litchfield-zocdoc

Okay after more reading and finding this issue (https://github.com/siddharthkp/bundlesize/issues/155), I am guessing this is because I haven't granted commit status access to bundlesize. It seems like the simple checking against thresholds works fine without granting access, but comparing against master does not.

carly-litchfield-zocdoc avatar Jun 06 '18 16:06 carly-litchfield-zocdoc

Despite granted the permission, but I still have this same issue

image

vinhlh avatar Sep 26 '18 06:09 vinhlh

The same issue in Github and https://bundlesize-store.now.sh is showing +0B on master branch.

bundlesize: v0.17.1

"bundlesize": [
  {
    "path": "./index.js",
    "maxSize": "800 B"
  },
  {
    "path": "./*.min.js",
    "maxSize": "700 B"
  }
]

image

joseluisq avatar Jan 31 '19 08:01 joseluisq

We're also experiencing the same issue at https://github.com/coralproject/talk here:

image

We run bundlesize via npx bundlesize with the following config:

  "bundlesize": [
    {
      "path": "./dist/static/assets/js/embed.js",
      "maxSize": "15 kB"
    },
    {
      "path": "./dist/static/assets/js/count.js",
      "maxSize": "2 kB"
    }
  ]

Which can be seen at: https://bundlesize-store.now.sh/build?info=%7B%22files%22%3A%5B%7B%22maxSize%22%3A15360%2C%22path%22%3A%22.%2Fdist%2Fstatic%2Fassets%2Fjs%2Fembed.js%22%2C%22size%22%3A14806%2C%22compression%22%3A%22gzip%22%7D%2C%7B%22maxSize%22%3A2048%2C%22path%22%3A%22.%2Fdist%2Fstatic%2Fassets%2Fjs%2Fcount.js%22%2C%22size%22%3A1373%2C%22compression%22%3A%22gzip%22%7D%5D%2C%22repo%22%3A%22coralproject%2Ftalk%22%2C%22branch%22%3A%22feature%2FCORL-1013%22%2C%22commit_message%22%3A%22%22%2C%22sha%22%3A%220f70ef29117b54be25dc87005e35b112d4bfbfc2%22%7D

Which for some reason as well, is not loading the master numbers even though the same command (npx bundlesize) with the same environment is run on master builds.

wyattjoh avatar May 12 '20 20:05 wyattjoh

Hey!

I'm working on a new version (1.0.0) of bundlesize that fixes all of these problems.

To not break any of the applications that use bundlesize with npx or with @latest, I'm building in a separate repo + app (until it's ready)

If you'd like you can try it out: https://github.com/siddharthkp/bundlesize2

Migration path:

  1. Use the npm package bundlesize2 instead of bundlesize
  2. If you'd like status reported back to github, use the flag --enable-github-checks + authorize bundlesize2 app. More in the docs
  3. You can remove BUNDLESIZE_GITHUB_TOKEN from your CI now
  4. If anything breaks, let me know :)

Note: This is only until the new version is ready and then it will be merged back in this project as a major release

siddharthkp avatar May 12 '20 20:05 siddharthkp

Just switched it out @siddharthkp, looks and works great! That fixed the issue.

What isn't clear is if you still require the BUNDLESIZE_GITHUB_TOKEN environment variable. I'd suggest adding a line for migrating describing what to do with that.

wyattjoh avatar May 12 '20 21:05 wyattjoh

I'm glad!

Don't need GITHUB_TOKEN anymore because you have to install the app. Will add to migration guide 👍

siddharthkp avatar May 12 '20 22:05 siddharthkp