- Issue created by @sergey_gabrielyan
- 🇪🇸Spain idiaz.roncero Madrid
Your URL starts with http://default/, which might be the problem - it looks like it won't be accessible by Storybook.
This might be related to the way the `drush storybook:generate-stories` is run. Are you running it from inside a container (docker, ddev, lando)? I'm facing this same issue: the URL generated does include a "default" part instead of the site URL.
- Status changed to Closed: cannot reproduce
4 months ago 9:44pm 9 September 2024 - 🇨🇦Canada tanner.svg
I was running in the same issue where after following the "Drupal & Storybook in 5 Minutes" video and generating the
.stories.json
files usingdrush storybook:generate-stories
.I was met with the following error:
Upon reviewing my button.stories.json file I observed the same server URL as shown in this issue's screenshot.
"parameters": { "server": { "url": "http://default/storybook/stories/render" } },
Note: I am NOT using a container (docker, ddev, lando) for my local environment (my development environment is running directly on my local machine).
----
In my case the solution was to add:
export DRUSH_OPTIONS_URI="http://my-local-site-url.localhost"
to my ~/.bash-profile, delete the already generated .stories.json files, then re-run
drush storybook:generate-stories
. After that the generated JSON was corrected to:"parameters": { "server": { "url": "http://my-local-site-url.localhost/storybook/stories/render" } },
and my stories began working as expected.
----
Additional note: I did reference a .lando.yml file to come to the conclusion as to what I needed. I've never needed this environment variable set to work on a Drupal site prior to using this module so maybe something could be added to this module to account for that? Or perhaps document how to work around this scenario if not using a container. Here's the lando config i referenced where this environment variable is set.
tooling: drush: service: appserver env: DRUSH_OPTIONS_URI: "https://my-local-site-url.lndo.site/"