Problem/Motivation
The module throws a type error in a construct method when installing and enabling on a site that uses the storybook module. The error message is the following:
TypeError: Drupal\pwa\Form\ManifestConfigurationForm::__construct(): Argument #8 ($fileUrlGenerator) must be of type Drupal\Core\File\FileUrlGenerator, Drupal\storybook\FileUrlGenerator given, called in /var/www/html/web/modules/contrib/pwa/src/Form/ManifestConfigurationForm.php on line 158 in Drupal\pwa\Form\ManifestConfigurationForm->__construct() (line 114 of modules/contrib/pwa/src/Form/ManifestConfigurationForm.php).
Steps to reproduce
Install and enable the storybook module with the pwa module enabled and navigate to the settings page for PWA (/admin/config/services/pwa/manifest).
Proposed resolution
Use the FileUrlGeneratorInterface type instead of FileUrlGenerator type for the method argument that throws the error.
(See #3470148: Type error when installing the storybook module)
Issue fork pwa-3488388
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
joshahubbers commentedComment #4
sourav_paulComment #5
ambient.impactYikes. Reminds of when the Hux module started out and discovered there were a few modules that were type hinting to the
ModuleHandlerclass instead ofModuleHandlerInterfacelike they should have. I'm thinking we should expand the scope of this issue to fix any other instances in the module where we're type hinting to classes rather than interfaces. What do you all say?Comment #6
anybodyImportant fix! Thank you!
Comment #8
anybodyComment #10
kryber commentedambient.impact: yeah!