storybookjs/storybook

[Bug]: composition - CORS issues interactions addon

Open

#21,502 opened on Mar 9, 2023

View on GitHub
 (3 comments) (1 reaction) (0 assignees)TypeScript (10,058 forks)batch import
bugcompositionhelp wantedsev:S3

Repository metrics

Stars
 (89,909 stars)
PR merge metrics
 (Avg merge 7d 22h) (184 merged PRs in 30d)

Description

Describe the bug

Reported by @yannbf during QA:

Composed stories that contain the play function execute the play function correctly, but the interactions panel shows “no interactions” because of the following error:

DOMException: Blocked a frame with origin "http://localhost:6007/" from accessing a cross-origin frame.
at new Instrumenter (http://localhost:6007/node_modules/.cache/.vite-storybook/deps/@storybook_addon-interactions_preview.js?v=56a43576:712:93)

It looks like the 7.0 instrumenter still uses the pattern or trying to access the parent's frame: https://github.com/storybookjs/storybook/blob/62ccd7ec53ca82ab46e78aad0b4b42f147dd02ef/code/lib/instrumenter/src/instrumenter.ts#L103

It should not do this, or we just accept / document that the interactions addon isn't composition compatible.

To Reproduce

No response

System

No response

Additional context

No response

Contributor guide