ValueError : Path cannot be empty dans file_get_contents() (/Applications/MAMP/htdocs/core/lib/Drupal/Core/Asset/CssOptimizer.php Primary tabs View(active tab) Edit

Created on 17 January 2023, almost 2 years ago
Updated 3 February 2023, almost 2 years ago

Hello, sorry for my English because I am French and I use a translator.

I am under drupal 9.5.1 in php 7.4.21 and when I try to put my site in php 8.0.8 (or 8.2), I have this error message: "The site has encountered an unexpected error. Please try again later."
If I deactivate the advagg module, the site is functional again and if I go back to php 7.4.21 the site is also functional again
the problem is the same with advagg version 8.X-4.1.

In recent log messages I have this php problem:

ValueError : Path cannot be empty dans file_get_contents() (/Applications/MAMP/htdocs/core/lib/Drupal/Core/Asset/CssOptimizer.php ligne 150)
#0 /Applications/MAMP/htdocs/core/lib/Drupal/Core/Asset/CssOptimizer.php(150): file_get_contents('')
#1 /Applications/MAMP/htdocs/core/lib/Drupal/Core/Asset/CssOptimizer.php(86): Drupal\Core\Asset\CssOptimizer->loadFile('', true)
#2 /Applications/MAMP/htdocs/core/lib/Drupal/Core/Asset/CssOptimizer.php(53): Drupal\Core\Asset\CssOptimizer->processFile(Array)
#3 /Applications/MAMP/htdocs/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php(121): Drupal\Core\Asset\CssOptimizer->optimize(Array)
#4 /Applications/MAMP/htdocs/core/lib/Drupal/Core/Asset/AssetResolver.php(176): Drupal\Core\Asset\CssCollectionOptimizer->optimize(Array)
#5 /Applications/MAMP/htdocs/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php(312): Drupal\Core\Asset\AssetResolver->getCssAssets(Object(Drupal\Core\Asset\AttachedAssets), true)
#6 /Applications/MAMP/htdocs/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php(158): Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries(Object(Drupal\Core\Asset\AttachedAssets), Array)
#7 /Applications/MAMP/htdocs/core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php(45): Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object(Drupal\Core\Render\HtmlResponse))
#8 [internal function]: Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object(Symfony\Component\HttpKernel\Event\ResponseEvent), 'kernel.response', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#9 /Applications/MAMP/htdocs/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ResponseEvent), 'kernel.response', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#10 /Applications/MAMP/htdocs/vendor/symfony/http-kernel/HttpKernel.php(202): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ResponseEvent), 'kernel.response')
#11 /Applications/MAMP/htdocs/vendor/symfony/http-kernel/HttpKernel.php(190): Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object(Drupal\Core\Render\HtmlResponse), Object(Symfony\Component\HttpFoundation\Request), 1)
#12 /Applications/MAMP/htdocs/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#13 /Applications/MAMP/htdocs/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /Applications/MAMP/htdocs/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /Applications/MAMP/htdocs/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /Applications/MAMP/htdocs/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /Applications/MAMP/htdocs/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /Applications/MAMP/htdocs/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /Applications/MAMP/htdocs/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /Applications/MAMP/htdocs/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /Applications/MAMP/htdocs/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#22 {main}

Do you know how to solve this problem?

Thank you for your help

💬 Support request
Status

Active

Version

6.0

Component

Code

Created by

🇫🇷France pedrocorse

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024