DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.
See original GitHub issue“@percy/storybook”: “^3.3.1”
After building Storybook and running percy-storybook --widths=320,1280 --debug
, I get the following error:
Error: Error: Evaluation failed: Error: Storybook object not found on window. Open your storybook and check the console for errors.
at checkStories (__puppeteer_evaluation_script__:23:16)
at __puppeteer_evaluation_script__:20:11
at ExecutionContext._evaluateInternal (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/puppeteer/lib/ExecutionContext.js:81:15)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async ExecutionContext.evaluate (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/puppeteer/lib/ExecutionContext.js:48:12)
-- ASYNC --
at ExecutionContext.<anonymous> (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/puppeteer/lib/helper.js:111:15)
at DOMWorld.evaluate (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/puppeteer/lib/DOMWorld.js:112:20)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
-- ASYNC --
at Frame.<anonymous> (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/puppeteer/lib/helper.js:111:15)
at Page.evaluate (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/puppeteer/lib/Page.js:833:43)
at Page.<anonymous> (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/puppeteer/lib/helper.js:112:23)
at _callee$ (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/@percy/storybook/lib/getStories.js:64:25)
at tryCatch (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.<computed> [as next] (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/camh/Sites/ssr-frontend/apps/unified-checkout/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
From here, I open the storybook-static index file, and I’m seeing the following in the console:
Adding a click listener to iframe failed: DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.
Screenshot:
Any ideas?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
blocked a frame of origin "null" from accessing a cross-origin ...
This happens because Chrome doesn't allow frames from your hard disk to access each others' content. Which, technically we term as Cross-origin request....
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 >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 "null" from accessing a cross ...
Because of the 'Cross-origin' request, the 'blocked a frame with origin "null" from accessing a cross-origin frame' error occurs.
Read more >Firefox does not block a frame with origin "null" from accessing ...
Because of the 'Cross-origin' request, the 'blocked a frame with origin "null" from accessing a cross-origin frame' error occurs. There are several workarounds ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Robdel12 I think I’ve made some progress.
In our repo, we’ve abstracted Storybook as a dependency and it’s configuration through a tool called pixeloven.
Our tool uses the following command to build Storybook:
pixeloven story build
. From here, a static version of Storybook is built into astories
directory.So essentially, when I build storybook using
build-storybook
and navigate tostorybook-static
, it doesn’t work. Perhaps because our config is abstracted through pixeloven-storybook or something.However, when I build storybook using
pixeloven story build
, and then navigate to the version created instories
, that version renders correctly.So I’m curious if there is a way to tell the
percy-storybook
command to look instories
instead ofstorybook-static
?Sweet! Super happy that helped get you going in the right direction 😄