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

Error when using bundle-stats v4.14.0 #4636

Closed
BPScott opened this issue Aug 12, 2024 · 4 comments · Fixed by #4635
Closed

Error when using bundle-stats v4.14.0 #4636

BPScott opened this issue Aug 12, 2024 · 4 comments · Fixed by #4635
Assignees
Labels
bug Something isn't working

Comments

@BPScott
Copy link

BPScott commented Aug 12, 2024

The changes in bundle-stats v4.14.0 that let you identify what chunks a module belongs to looks super useful.

However the stats file produced by rollup-plugin-webpack-stats v1.0.2 causes a runtime error when clicking a module in the modules tab.

bundle-stats.html:2 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'size')
    at Cs (bundle-stats.html:2:311443)

The UI seems to be unable to recover from this error, and I am no longer able to click into other tabs.

I suspect size, and probably other pieces of information that were previously not required by bundle-stats, are now required, and as this package doesn't aim to produce a complete stats file, only including what bundle-stats needs, it hasn't been updated yet to include those new required data keys.

Reproduction steps

  • Run a Vite build that has been configured to use rollup-plugin-webpack-stats v1.0.2. (the repo I'm using is private so I don't want to post the generated stats file publicly, but I suspect any vite build would work).
  • Pass the generated stats file into bundle-stats v4.14.0
  • Open up the html report, click the modules tab, then click on a module in the table. See the error above appear in the console.
@vio
Copy link
Member

vio commented Aug 12, 2024

@BPScott thanks for creating the issue!

It sounds like a regression, though we are testing bundle-stats releases with various formats, including the one from rollup-plugin-webpack-stats.

If it is possible to share your webpack stats privately, please send them to the email address visible on my gh profile.

@vio vio self-assigned this Aug 12, 2024
@vio vio added investigation bug Something isn't working and removed investigation labels Aug 12, 2024
@vio vio transferred this issue from relative-ci/rollup-plugin-webpack-stats Aug 12, 2024
@vio
Copy link
Member

vio commented Aug 12, 2024

Was able to replicate the issue for cases when the report has no baseline, that's a case we are not testing automatically.

If you get the chance, can you please try v4.14.1-beta.0 ?

@BPScott
Copy link
Author

BPScott commented Aug 12, 2024

v4.14.1-beta.0 fixes the issue for me - clicking a row in the modules table shows the overlay sheet with info. Thank you!

You are correct, I ran into this bug when getting stats for a single build, without a baseline.

As an aside/polish idea: It feels a little odd to show size change information when looking at a single build. I'd be tempted to consider removing the +2.91KiB / +100% red diff text when there is no baseline.

Screenshot 2024-08-12 at 13 13 34

@vio vio closed this as completed in #4635 Aug 13, 2024
@vio
Copy link
Member

vio commented Aug 13, 2024

@BPScott thank you for checking! The fix is now available on v4.14.1.

As an aside/polish idea: It feels a little odd to show size change information when looking at a single build. I'd be tempted to consider removing the +2.91KiB / +100% red diff text when there is no baseline.

Indeed, we do not know if the baseline value is missing or just empty, will handle it here: #4639. Thank you for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants