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

fix: stringify functions in toRawDeep #152

Merged
merged 2 commits into from
Jul 6, 2022
Merged

Conversation

bounoable
Copy link
Contributor

Description

The state watcher in packages/histoire/src/client/app/sandbox.ts uses toRawDeep to send the story state to the app using Window.postMessage(). If the state contains a function, Window.postMessage() fails with the error "DOMException: Failed to execute 'postMessage' on 'Window': () => alert("example") could not be cloned." and the sandbox in the app doesn't show the component.

This PR fixes the issue by stringifying functions within toRawDeep.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@netlify
Copy link

netlify bot commented Jun 23, 2022

Deploy Preview for histoire-examples-vue3 ready!

Name Link
🔨 Latest commit a77dce6
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-vue3/deploys/62c571b571aa740008fbdbda
😎 Deploy Preview https://deploy-preview-152--histoire-examples-vue3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Jun 23, 2022

Deploy Preview for histoire-site ready!

Name Link
🔨 Latest commit a77dce6
🔍 Latest deploy log https://app.netlify.com/sites/histoire-site/deploys/62c571b5713ec10008366651
😎 Deploy Preview https://deploy-preview-152--histoire-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Jun 23, 2022

Deploy Preview for histoire-controls ready!

Name Link
🔨 Latest commit a77dce6
🔍 Latest deploy log https://app.netlify.com/sites/histoire-controls/deploys/62c571b5452d570009d0372b
😎 Deploy Preview https://deploy-preview-152--histoire-controls.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@Akryum Akryum merged commit 30077c0 into histoire-dev:main Jul 6, 2022
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

Successfully merging this pull request may close these issues.

2 participants