Skip to content

fix: handle null stats JSON in Socket server#4784

Merged
chenjiahan merged 1 commit intomainfrom
stats_json_null_0314
Mar 14, 2025
Merged

fix: handle null stats JSON in Socket server#4784
chenjiahan merged 1 commit intomainfrom
stats_json_null_0314

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Mar 14, 2025

Summary

Handle null stats JSON in Socket server.

If the previous compilation is removed on the Rust side, stats.toJson gets a null instead of an object.

Failed to get stats due to error: Unable to access compilation with id = CompilationId(1) now. The compilation have been removed on the Rust side. The latest compilation id is CompilationId(4), are you trying to access the stats from the previous compilation?
file:///user/app/node_modules/.pnpm/@rsbuild+core@1.2.18/node_modules/@rsbuild/core/dist/index.js:5275
        if (statsJson.entrypoints) for (let entrypoint of Object.values(statsJson.entrypoints)){
                      ^

TypeError: Cannot read properties of null (reading 'entrypoints')
    at SocketServer.sendStats 

Related Links

https://discord.com/channels/977448667919286283/1167025132905173063/1349740225999405218
web-infra-dev/rspack#9687

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Mar 14, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 773245e
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/67d39539a105dc0008c55bbb
😎 Deploy Preview https://deploy-preview-4784--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 71 (no change from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@chenjiahan chenjiahan merged commit 7cca7b7 into main Mar 14, 2025
12 checks passed
@chenjiahan chenjiahan deleted the stats_json_null_0314 branch March 14, 2025 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant