Problem/Motivation
First of all, a big thank you to the module developers.
Unfortunately we have a problem.
We installed Single Directory Components (sdc) and Theme Server (cl_server) and followed these instructions to install Storybook:
https://git.drupalcode.org/project/cl_server/-/blob/2.x/docs/storybook.md
We also installed the sdc Example modules.
The components work and can also be inserted into the Twig template. We only have a problem with Storybook in connection with the cl_server. The endpoint from the cl_server always has a response 500 with the error:
Drupal\sdc\Exception\InvalidComponentException: The component "sdc_examples:my-cta" does not provide schema information. Schema definitions are mandatory for components declared in modules. For components declared in themes, schema definitions are only mandatory if the "enforce_sdc_schemas" key is set to "true" in the theme info file. in Drupal\sdc\Component\ComponentValidator->validateDefinition() (line 62 of modules/contrib/sdc/src/Component/ComponentValidator.php).
in this example it is the components from the sdc_epample module "sdc_examples:my-cta"
My own components in the theme folder (under /web/themes/custom/my_theme/components) have the same error.
Putting the components inside of /web/themes/custom/my_theme/templates/components will also not work, with a different error, that the plugin cannot be found. So putting the components inside of /web/themes/custom/my_theme/components feels right.
Steps to reproduce
Install:
Drupal 10.1.6
sdc:^2.0@alpha
sdc_examples
cl_server:^2.0@beta
Storybook 6.5, I've already tried version 7.5 as well with no success
package.json
"devDependencies": {
"@babel/core": "^7.21.4",
"@lullabot/storybook-drupal-addon": "^1.0.27",
"@mdx-js/react": "^1.6.22",
"@storybook/addon-actions": "^6.5.16",
"@storybook/addon-docs": "^6.5.16",
"@storybook/addon-essentials": "^6.5.16",
"@storybook/addon-links": "^6.5.16",
"@storybook/builder-webpack5": "^6.5.16",
"@storybook/cli": "^6.5.16",
"@storybook/manager-webpack5": "^6.5.16",
"@storybook/server": "^6.5.16",
"babel-loader": "^8.3.0"
}
Storybook installed according to instructions:
https://git.drupalcode.org/project/cl_server/-/blob/2.x/docs/storybook.md
We get this error message on the /_cl_server endpoint:
https://my-local-page/_cl_server?_storyFileName=.%2Fweb%2Fmodules%2Fcont...()
error message:
Drupal\sdc\Exception\InvalidComponentException: The component "sdc_examples:my-cta" does not provide schema information. Schema definitions are mandatory for components declared in modules. For components declared in themes, schema definitions are only mandatory if the "enforce_sdc_schemas" key is set to "true" in the theme info file. in Drupal\sdc\Component\ComponentValidator->validateDefinition() (line 62 of modules/contrib/sdc/src/Component/ComponentValidator.php).
We currently have no idea what the reason for this error is and are hoping for help.
Thanks