Skip to content

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

@andrzej-woof

Description

@andrzej-woof

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions