Use of private decorator FileUrlGenerator causes serialization error on install of other modules

Created on 3 December 2024, 4 months ago

Problem/Motivation

I added storybook to an install profile along with the

On site install, I got the error

In MemoryBackend.php line 123:

Serialization of 'Closure' is not allowed

I tracked this error to ComponentSelectorElement inside https://www.drupal.org/project/cl_editorial β†’
This file uses the FileUrlGenerator service which is being overridden in storybook via a Synfony service decorator

  Drupal\storybook\FileUrlGenerator:
    decorates: file_url_generator
    public: false
    arguments: ['@Drupal\storybook\FileUrlGenerator.inner', '@request_stack']

If I remove this service decorator, cl_editorial installs fine. This leads to believe there is an issue in how the Synfony decorator layer is handling \Drupal\storybook\FileUrlGenerator

If I simplify the service decorator and set the storybook service to public (see patch) the cl_editorial module installs just fine and \Drupal\storybook\FileUrlGenerator works as intended (making absolute URL paths).

I'm not fully convinced this is an issue with Storybook, but am hoping someone with more knowledge of the Symfony service decorator layer can help me understand whats' going on.

Steps to reproduce

Create an install profile with https://www.drupal.org/project/cl_editorial β†’ (3.0.0-rc2) and https://www.drupal.org/project/storybook β†’ (1.0.2)

πŸ› Bug report
Status

Active

Version

1.0

Component

Miscellaneous

Created by

πŸ‡¬πŸ‡§United Kingdom rjjakes

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

Comments & Activities

Production build 0.71.5 2024