storycap icon indicating copy to clipboard operation
storycap copied to clipboard

Trailing slash in URL causes no preview on screenshots without any error message

Open andrzej-woof opened this issue 4 months ago • 0 comments

Took me a while to figure this out but apparently (at least on my setup with storybook 8) passing storybook URL with trailing slash for example:

storycap --serverCmd "npx http-server ./storybook-static --port 6006" http://127.0.0.1:6006/ --outDir ./screenshots

make storycap navigate to http://127.0.0.1:6006//iframe.html?... (note the double slash) and then it fails setting stories with uncaught SecurityError as follows

CleanShot 2024-10-09 at 06 40 19

which BTW wasn't forwarded to console even with --forwardConsoleLogs --verbose flags and I could only observe it when I've disabled headless mode.

Changing from http://127.0.0.1:6006/ to http://127.0.0.1:6006 fixes the problem

andrzej-woof avatar Oct 09 '24 04:10 andrzej-woof