fix: use stringifySafe for serializing messages in FuseboxReactDevToolsDispatcher #53405
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Replace JSON.stringify with stringifySafe in FuseboxReactDevToolsDispatcher to safely serialize messages that may contain circular refs. This prevents errors observed when some plugins (e.g., on rozenite.dev) emit circular structures and hardens the dispatcher for other callers.
Changelog:
[GENERAL] [FIXED] - Prevent errors when serializing messages with circular references in FuseboxReactDevToolsDispatcher by using stringifySafe.
Test Plan:
Repro before: use a plugin that emits a circular structure (e.g., via rozenite.dev) → app crashes with “Converting circular structure to JSON”.
After change: no crash; messages are delivered; receiving side still JSON.parses and emits as expected.