fix: deep-clone postMessage payloads to avoid DataCloneError with framework proxies#139
Merged
behnam-oneschema merged 2 commits intomainfrom Mar 19, 2026
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
hkardos
approved these changes
Mar 19, 2026
…mework proxies Vue reactive Proxy objects passed as launch params (e.g. templateOverrides, customizationOverrides) cause a DataCloneError when postMessage attempts structured cloning. This applies a JSON round-trip to strip non-structurally-cloneable wrappers before posting to the iframe. Fixes both the Importer and FileFeeds packages. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
4a6b8a6 to
07c15e7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Customer reported that upgrading
@oneschema/vuefrom0.6.xto0.7.2broke their production — Vue reactive Proxy objects in launch params (e.g.templateOverrides,customizationOverrides) cause aDataCloneErrorwhenpostMessageattempts structured cloning on the iframe message.This applies a
JSON.parse(JSON.stringify(...))deep-clone to thepostMessagepayload in both the Importer and FileFeeds#iframeEventEmitmethods. This strips non-structurally-cloneable wrappers (like Vue'sProxy) before posting to the iframe.The fix is in the core packages rather than the Vue wrapper so it is framework-agnostic and defensive against similar issues from other reactive frameworks.
Review & Testing Checklist for Human
undefinedvs absent-key semantics —JSON.stringifyomits object keys withundefinedvalues (whereas structured clone preserves them asundefined). Check that the embed app'spostMessagehandler does not distinguish between a missing key and an explicitundefined.templateOverrides/customizationOverridestoimporter.launch()— confirm theDataCloneErrorno longer occurs and the import session initializes correctly.Notes
postMessagepattern exists in FileFeeds.JSON.parse(JSON.stringify(...))will also drop anyDate,RegExp, or function values — these types don't appear in the current payload interfaces, but worth being aware of if the message shape evolves.Link to Devin session: https://app.devin.ai/sessions/71ec3b816ec04b519a0dd348218fd107
Requested by: @behnam-oneschema