- Issue created by @tanc
- @tanc opened merge request.
Automatically closed - issue fixed for 2 weeks with no activity.
In version 1.3.0 the condition for checking if the css
array element exists is incorrect and outputs a warning
[variables] => Array
│ (
│ [%type] => Warning
│ [@message] => Drupal\Core\Render\Markup Object
│ (
│ [string:protected] => Undefined array key "css"
│ )
│
│ [%function] => Drupal\vite\Manifest->getStyles()
│ [%file] => /var/www/site/web/modules/contrib/vite/src/Manifest.php
│ [%line] => 77
Add a module libraries.yml
entry which includes vite
but doesn't include a css
element. Then rebuild caches and note the error in the drush output.
The if statement should be changed from:
if (
!$this->chunkExists($chunk)
|| isset($this->manifest[$chunk]['css'])
|| !is_array($this->manifest[$chunk]['css'])
) {
return [];
}
to:
if (
!$this->chunkExists($chunk)
|| !isset($this->manifest[$chunk]['css'])
|| !is_array($this->manifest[$chunk]['css'])
) {
return [];
}
Active
1.3
Code
Automatically closed - issue fixed for 2 weeks with no activity.