Issue Bug Closed

#109258Issue with vite & 14 after 109246

Georg Ringer 03/16/26, 12:43 updated 03/31/26, 08:09

Description

Afer #109246

PHP Warning: Undefined array key 1 in /var/www/html/vendor/typo3/cms-core/Classes/SystemResource/Publishing/DefaultSystemResourceUriGenerator.php line 105

line 105 is the first of

[$relativePrefix, $relativeAssetPath] = explode(
            ResourceCollectionInterface::PACKAGE_DEFAULT_PUBLIC_DIR,
            substr($absoluteResourcePath, strlen(Environment::getProjectPath())),
            2
        );

the argument which leads to this issue is
/Users/georgringer/projects/xxx/yyy/public/_assets/vite/link.js , working files are e.g. /var/www/html/vendor/fonda/f-theme/Resources/Public/assets/index.js

debugging the AssetRenderer::renderJavaScript, shows that vite filles it with e.g.

vite:stories/element/link/link => array(3 items)
source => '/_assets/vite/link.js' (21 chars)
attributes => array(1 item)
type => 'module' (6 chars)
options => array(3 items)
external => TRUE
priority => FALSE
useNonce => FALSE

and the link.js is in packages/f_theme/Resources/Public/assets/link.js

——

maybe it is the fault of ViteService which does

    protected function prepareAssetPath(string $assetPath, bool $external): string
    {
        return $external ? PathUtility::getAbsoluteWebPath($assetPath) : $assetPath;
    }

but skipping this method and just using /var/www/html/public/_assets/vite/link.js leads to the exception Absolute paths are not allowed as resource identifiers at vendor/typo3/cms-core/Classes/SystemResource/SystemResourceFactory.php:99

Reviews 1