Repository navigation
fix: keep the site up when a Vite build is missing - #454
Merged
Merged
Conversation
Laravel's Vite throws on a missing manifest, and blocks resolve their scripts while WordPress boots: one unbuilt theme answered 500 on every request, wp-admin and wp-login.php included. A container with neither a hot file nor a manifest now gives no asset URLs; the missing build is logged once per request and named in an admin notice. Fixes Pollora/pollora#79
ogorzalka
force-pushed
the
fix/missing-theme-build
branch
from
October 9, 2026 15:39
037bf3d to
99f2d7b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Pollora/pollora#79.
Problem
When a theme's build is missing (npm absent, build failed,
public/builddeleted), every request answered 500,wp-login.phpand wp-admin included:Vite manifest not found at public/build/theme/default/manifest.json.Thrown while WordPress boots:
init→ block registration →BlockRegistrar::registerScriptHandle()→ViteManager::getAssetUrls()→ thegetAssetUrlsVite macro →Vite::manifest(). The layout'sAsset::url()reads the same manifest throughViteManager::asset().Fix
ViteManager::isMissingBuild(): neither a running dev server nor a manifest. ThengetAssetUrls()returns['js' => [], 'css' => []]andasset()an empty string, instead of throwing. Blocks register without scripts, theme assets are left out.MissingBuilds(singleton) records each missing build: oneLog::warningper container per request, with the manifest path.MissingBuildNoticeonadmin_notices(users withmanage_options): one line per manifest with the containers using it,npm install && npm run build(ddev npm …under DDEV) andphp artisan pollora:doctor, whose builds check names the folder.Tests
asset()→'', no exception.Checked on a real site
On
pollora-debugbar, build hidden (public/build/theme/defaultrenamed):/, a page,wp-login.php,wp-admin→ 500Vite manifest not found/→ 200,wp-login.php→ 200 (login form),wp-admin→ login redirect; log:Pollora: the "theme" assets are not built, no Vite manifest at …;admin_noticesfor an admin prints "Pollora: assets not built — theme.blocks, theme — no manifest at public/build/theme/default/manifest.json".Changelog:
[Unreleased]→### Fixed.