You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running storycap with a URL that contains a query parameter fails to load, for example:
npx storycap http://localhost:6006\?theme\=dark
info Wait for connecting storybook server http://localhost:6006?theme=dark.
info Executable Chromium path: <redacted>
error waiting for function failed: timeout 60000ms exceeded
It appears to be due to storycrawler assuming the URL doesn't contain query string parameters, i.e.:
Where it attempts to visit this.connection.url + '/iframe.html?selectedKind=story-crawler-kind&selectedStory=story-crawler-story', which in the above example would resolve to 'http://localhost:6006?theme=dark/iframe.html?selectedKind=story-crawler-kind&selectedStory=story-crawler-story'
Expected outcome
Query parameters are present when storycap loads each story.
Why?
It's possible to initialise Storybook globals using query string parameters. This is useful for capturing multiple themes without needing to re-build Storybook, for example.
How?
Split this.connection.url in to hostname and search. Use hostname as the base URL (this.connection.url) and merge search (query string params) in to the ones that storycrawler adds.
The text was updated successfully, but these errors were encountered:
Running
storycap
with a URL that contains a query parameter fails to load, for example:It appears to be due to
storycrawler
assuming the URL doesn't contain query string parameters, i.e.:https://github.com/reg-viz/storycap/blob/master/packages/storycrawler/src/browser/stories-browser.ts#L70
Where it attempts to visit
this.connection.url + '/iframe.html?selectedKind=story-crawler-kind&selectedStory=story-crawler-story'
, which in the above example would resolve to'http://localhost:6006?theme=dark/iframe.html?selectedKind=story-crawler-kind&selectedStory=story-crawler-story'
Expected outcome
Query parameters are present when
storycap
loads each story.Why?
It's possible to initialise Storybook globals using query string parameters. This is useful for capturing multiple themes without needing to re-build Storybook, for example.
How?
Split
this.connection.url
in tohostname
andsearch
. Usehostname
as the base URL (this.connection.url
) and mergesearch
(query string params) in to the ones thatstorycrawler
adds.The text was updated successfully, but these errors were encountered: