StoryCollector generates empty stories attribute

Created on 14 February 2024, 4 months ago

Problem

I’ve follow all the examples in the README installing the storybook module and setting up a demo component / story. However, when running drush storybook:generate-all-stories the json file is generated without any stories but with title and parameters.

I tried debugging the StoryCollector / StoryRenderer. The {% story %} data is actually present in the temporary TwigTemplate code generated by the renderer, but not in the wrapper meta. Neither StoryCollector::setWrapperData() nor StoryCollector::collect() receives any story meta. The collect() method is never called.

Example

This stories.twig:

{% stories terms_menu with {
  title: 'Demo/Navigation Components/Terms Menu',
  parameters: {
    backgrounds: {
      default: 'dark'
    }
  },
  tags: ['autodocs']
} %}

  {% story test with {
    name: 'Test'
  } %}
    <h1>Hello world</h1>
  {% endstory %}

{% endstories %}

generates this json:

{
  "title": "Demo\/Navigation Components\/Terms Menu",
  "parameters": {
    "backgrounds": {
      "default": "dark"
    },
    "server": {
      "url": "https:\/\/MYDOMAIN\/storybook\/stories\/render"
    }
  },
  "tags": [
    "autodocs"
  ],
  "stories": []
}
πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Other tooling

Created by

πŸ‡³πŸ‡±Netherlands basvredeling Amsterdam

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @basvredeling
  • Status changed to Postponed: needs info 4 months ago
  • e0ipso Can Picafort

    Can you also post the version of Drupal core, the version of the module, the version of e0ipso/twig-storybook, and the version of twig/twig?

  • Status changed to Closed: outdated 4 months ago
  • πŸ‡³πŸ‡±Netherlands basvredeling Amsterdam

    Updating to e0ipso/twig-storybook:1.3.1 fixes it, it seems.

Production build 0.69.0 2024