reg-viz / storycap

A Storybook Addon, Save the screenshot image of your stories :camera: via puppeteer.
https://www.npmjs.com/package/storycap
MIT License
691 stars 89 forks source link

storycap fails if there is an `<iframe>` element #563

Open yamanoku opened 2 years ago

yamanoku commented 2 years ago

I created a Vue.js file that loads in an <iframe> by passing YouTube video IDs in props, and ran storycap. However, when I executed it, I got an error Error: Execution context is not available in detached frame.

Error: Execution context is not available in detached frame "https://www.youtube.com/embed/EngW7tLk6R8?enablejsapi=1&loop=0&playlist=EngW7tLk6R8&rel=0&modestbranding=1" (are you trying to evaluate?)
    at DOMWorld.executionContext (/home/runner/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.js:82:19)
    at DOMWorld._onBindingCalled (/home/runner/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.js:364:36)
    at /home/runner/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.js:52:74
    at /home/runner/src/app/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js:51:62
    at Array.map (<anonymous>)
    at Object.emit (/home/runner/src/app/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js:51:43)
    at CDPSession.emit (/home/runner/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.js:72:22)
    at CDPSession._onMessage (/home/runner/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:225:18)
    at Connection._onMessage (/home/runner/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:101:25)
    at WebSocket.<anonymous> (/home/runner/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js:13:32)
error Command failed with exit code 1.
info Visit yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.
Resource Details ## Resource - Node.js: 16.14.0 - storycap: ^3.1.0 - storybook - @storybook/vue3: ~6.3.13 - vue: ^3.2.29 ### Vue.js file ```vue