- Issue created by @tanner.svg
- First commit to issue fork.
- 🇨🇦Canada tanner.svg
@mukeysh I do not use ddev personally so I can not confirm that this is a working solution, but based on my learnings about this issue and that the key to resolving it for myself was setting the
DRUSH_OPTIONS_URI
environment variables, I would suggest the following:Add the following to your project's
.ddev/config.yaml
:web_environment: - DRUSH_OPTIONS_URI=$DDEV_PRIMARY_URL
Looks like you can also use the CLI if you wanted. Reference to ddev docs here --> https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#environment-variables-for-containers-and-services
To check if it worked, go to your
.stories.json
file for one of your stories after generating stories with the drush command. You want it to be using your sites URI in the server URL. For example:"parameters": { "server": { "url": "http://my-site-url.ddev/storybook/stories/render" } },
If the value is
"http://default/storybook/stories/render"
then it's not working. - 🇬🇧United Kingdom tonypaulbarker Leeds
I am trying to set up by following the documentation and tutorials and see this failed to fetch output too. I am using ddev. I don't have multisite.
I tried to configure some different ways and have the optional ddev configuration described in the documentation.
The url in the json file is
https://mysite.ddev.site/storybook/stories/renderStorybook is being served at
https://mysite.ddev.site:6006/?path=/story/components-component-name--te...One thing I don't understand is why the url should be set to https://mysite.ddev.site/storybook/stories/render when nothing is served at that path.
- 🇬🇧United Kingdom tonypaulbarker Leeds
I followed the thread on this issue where there is a similar report https://www.drupal.org/project/storybook/issues/3438389 💬 Problem with initialising project Closed: works as designed . Maybe like those cases something is overriding development.services.yml
- 🇬🇧United Kingdom tonypaulbarker Leeds
Problem 1 was the additions to development.settings.yml was not being loaded as expected. From the issue earlier in the year it seems to be a common problem for people so could be added to troubleshooting.
Problem 2 was that after problem 1 was overcome the whole web page was being loaded in the storybook pane instead of isolated components. Adding the following snippet at line 3 to both .storybook/preview.js and .storybook/main.js solved the problem for me, although it may have been some combination of clearing caches and resetting that cleared out the problem.
server: { url: process.env.STORYBOOK_SERVER_URL || 'https://mysite.ddev.site/storybook/stories/render', },