question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught DOMException: Blocked a frame with origin "http://localhost:9009" from accessing a cross-origin frame.

See original GitHub issue

Describe the bug After updated storybook 3 to 5 the ‘actions addon’ throws CORS error when an action is performed. Figured out that setting the ‘depth’ option to 2 or less is a work around and no error appears. Posting bug report hoping any better solution may be found.

To Reproduce Steps to reproduce the behavior:

  1. Initiate any action on storybook 5. CORS error appears in console.

Expected behavior Actions should be performed.

Screenshots N/A

Code snippets I traced the bug to the following line:

      var data = (0, _telejson.stringify)({
        key: KEY,
        event: event
      }, {
        maxDepth: depth
      }); // TODO: investigate http://blog.teamtreehouse.com/cross-domain-messaging-with-postmessage
      // might replace '*' with document.location ?

      iframeWindow.postMessage(data, '*');
      return Promise.resolve(null);

This configuration fixes the issue. But it would be great to have this resolved and allow for display of action with greater depth of the object.

configureActions({
  depth: 2 // anything higher than 2 causes CORS error in iframe postMessage method
});

System:

  • OS: MacOS
  • Device: Macbook Pro 2018
  • Browser: chrome
  • Framework: react
  • Addons: actions
  • Version: 5.1.9

Additional context This happened after upgrading from 3 to 5. Default webpack config is used. Babel was also upgraded to 7.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:16
  • Comments:48 (14 by maintainers)

github_iconTop GitHub Comments

7reactions
brycesnydercommented, Sep 10, 2020

I’m getting this when attempting to build my local by running yarn build-storybook and then opening the index.html within the storybook-static repo… Just upgraded to 6.0.21

5reactions
ldevebercommented, Oct 16, 2020

I’m seeing this in 6.0.26. In my case, once I delete my one .mdx story, it builds and works fine. When I have a mix of js and mdx stories is when I see this error. I should also note that running yarn storybook works fine, its just when building the docs I see this error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SecurityError: Blocked a frame with origin from accessing a ...
SecurityError: Blocked a frame with origin "http://www.example.com" from accessing a cross-origin frame. How can I access the elements in the ...
Read more >
Blocked a frame with origin from accessing a cross-origin frame
Same-Origin Policy (SOP) restricts how a document or script loaded from one origin can interact with a resource from another origin.
Read more >
Blocked a frame with origin “domain.com” from accessing
Hi, Your error is expected if your page and Forms are using different domains. For the same-origin policy browsers block scripts trying to...
Read more >
Resolving the Blocked a Frame with Origin "null ... - HackerNoon
The 'blocked a frame with origin "null" from accessing a cross-origin frame` error occurs because of `Cross-originn` request.
Read more >
Uncaught DOMException: Blocked a frame with origin "http ...
Uncaught DOMException : Blocked a frame with origin "http://localhost:9009" from accessing a cross-origin frame.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found