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

File size miscalculation (with and without compression) #281

Open
flowzy opened this issue Feb 23, 2019 · 2 comments
Open

File size miscalculation (with and without compression) #281

flowzy opened this issue Feb 23, 2019 · 2 comments

Comments

@flowzy
Copy link

flowzy commented Feb 23, 2019

Do you want to request a feature or report a bug?
Report a bug.

What is the current behavior?
Test task fails, because bundlesize miscalculates file size.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Clone this repository
  2. Install dependencies, using Yarn (yarn install)
  3. Run yarn test (it will also compress images, so perhaps it's best to delete "headers" folder inside "src/img")
  4. See it fail, because it thinks the image "flair-sprite.png" is almost twice the size it really is. Example (in reality it is 473.03 KB)

The repository also has a "build shield", which redirects you to the Travis CI page. There you can check logs and see the build failing.

What is the expected behavior?
Test task successfully completes, because all file sizes are below the specified limit (500 KB).

Please mention other relevant information.

  • node version: v10.15.1 (lts/*) & v11.10.0 (node)
  • npm version: v6.4.1
  • Operating system: Linux & macOS
  • bundlesize version: ^0.17.1
  • CI you are using: Travis CI
@rtymchyk
Copy link

rtymchyk commented May 1, 2019

Seeing the same issue. File size is doubled in multiple instances.

@rkistner
Copy link

rkistner commented Nov 1, 2019

This is likely because it is attempting to read the file as a utf-8 string, instead of a raw binary Buffer.

Should be fixed by #267.

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

3 participants