Error on main with manifest

Hello,

I have installed latest main and have an error. Vite doesn’t create manifests? Or is a bad path? Because I use only sage without bedrock.

Fatal error: Uncaught Roots\Acorn\Assets\Exceptions\ManifestNotFoundException: The asset manifest [/app/wp-content/themes/webgravity/public/build/manifest.json] cannot be found. in /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php:122 Stack trace: #0 /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php(95): Roots\Acorn\Assets\Manager->getJsonManifest('/app/wp-content...') #1 /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php(71): Roots\Acorn\Assets\Manager->resolve('theme', Array) #2 /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Roots/Acorn/Assets/AssetsServiceProvider.php(27): Roots\Acorn\Assets\Manager->manifest('theme') #3 /app/wp-content/themes/webgravity/vendor/illuminate/container/Container.php(937): Roots\Acorn\Assets\AssetsServiceProvider->Roots\Acorn\Assets\{closure}(Object(Roots\Acorn\Application), Array) #4 /app/wp-content/themes/webgravity/vendor/illuminate/container/Container.php(819): Illuminate\Container\Container->build(Object(Closure)) #5 /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(1051): Illuminate\Container\Container->resolve('assets.manifest', Array, true) #6 /app/wp-content/themes/webgravity/vendor/illuminate/container/Container.php(755): Illuminate\Foundation\Application->resolve('assets.manifest', Array) #7 /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(1033): Illuminate\Container\Container->make('assets.manifest', Array) #8 /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Illuminate/Foundation/helpers.php(124): Illuminate\Foundation\Application->make('assets.manifest', Array) #9 /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Roots/helpers.php(17): app('assets.manifest') #10 /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Roots/globals.php(6): Roots\asset('images/firmy/in...') #11 /app/wp-content/cache/acorn/framework/views/69c1c30833576d225c4446ac4b578d42.php(34): asset('images/firmy/in...') #12 /app/wp-content/themes/webgravity/vendor/illuminate/filesystem/Filesystem.php(123): require('/app/wp-content...') #13 /app/wp-content/themes/webgravity/vendor/illuminate/filesystem/Filesystem.php(124): Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure}() #14 /app/wp-content/themes/webgravity/vendor/illuminate/view/Engines/PhpEngine.php(58): Illuminate\Filesystem\Filesystem->getRequire('/app/wp-content...', Array) #15 /app/wp-content/themes/webgravity/vendor/illuminate/view/Engines/CompilerEngine.php(75): Illuminate\View\Engines\PhpEngine->evaluatePath('/app/wp-content...', Array) #16 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(209): Illuminate\View\Engines\CompilerEngine->get('/app/wp-content...', Array) #17 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(192): Illuminate\View\View->getContents() #18 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(161): Illuminate\View\View->renderContents() #19 /app/wp-content/cache/acorn/framework/views/3ebff0b223b6700c27c82541f46a7dde.php(9): Illuminate\View\View->render() #20 /app/wp-content/themes/webgravity/vendor/illuminate/filesystem/Filesystem.php(123): require('/app/wp-content...') #21 /app/wp-content/themes/webgravity/vendor/illuminate/filesystem/Filesystem.php(124): Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure}() #22 /app/wp-content/themes/webgravity/vendor/illuminate/view/Engines/PhpEngine.php(58): Illuminate\Filesystem\Filesystem->getRequire('/app/wp-content...', Array) #23 /app/wp-content/themes/webgravity/vendor/illuminate/view/Engines/CompilerEngine.php(75): Illuminate\View\Engines\PhpEngine->evaluatePath('/app/wp-content...', Array) #24 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(209): Illuminate\View\Engines\CompilerEngine->get('/app/wp-content...', Array) #25 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(192): Illuminate\View\View->getContents() #26 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(161): Illuminate\View\View->renderContents() #27 /app/wp-content/themes/webgravity/index.php(3): Illuminate\View\View->render() #28 /app/wp-includes/template-loader.php(106): include('/app/wp-content...') #29 /app/wp-blog-header.php(19): require_once('/app/wp-include...') #30 /app/index.php(17): require('/app/wp-blog-he...') #31 {main} Next Illuminate\View\ViewException: The asset manifest [/app/wp-content/themes/webgravity/public/build/manifest.json] cannot be found. (View: /app/wp-content/themes/webgravity/resources/views/partials/front-page/logos.blade.php) in /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php:122 Stack trace: #0 /app/wp-content/themes/webgravity/vendor/illuminate/view/Engines/PhpEngine.php(60): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(Roots\Acorn\Assets\Exceptions\ManifestNotFoundException), 3) #1 /app/wp-content/themes/webgravity/vendor/illuminate/view/Engines/CompilerEngine.php(75): Illuminate\View\Engines\PhpEngine->evaluatePath('/app/wp-content...', Array) #2 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(209): Illuminate\View\Engines\CompilerEngine->get('/app/wp-content...', Array) #3 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(192): Illuminate\View\View->getContents() #4 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(161): Illuminate\View\View->renderContents() #5 /app/wp-content/cache/acorn/framework/views/3ebff0b223b6700c27c82541f46a7dde.php(9): Illuminate\View\View->render() #6 /app/wp-content/themes/webgravity/vendor/illuminate/filesystem/Filesystem.php(123): require('/app/wp-content...') #7 /app/wp-content/themes/webgravity/vendor/illuminate/filesystem/Filesystem.php(124): Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure}() #8 /app/wp-content/themes/webgravity/vendor/illuminate/view/Engines/PhpEngine.php(58): Illuminate\Filesystem\Filesystem->getRequire('/app/wp-content...', Array) #9 /app/wp-content/themes/webgravity/vendor/illuminate/view/Engines/CompilerEngine.php(75): Illuminate\View\Engines\PhpEngine->evaluatePath('/app/wp-content...', Array) #10 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(209): Illuminate\View\Engines\CompilerEngine->get('/app/wp-content...', Array) #11 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(192): Illuminate\View\View->getContents() #12 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(161): Illuminate\View\View->renderContents() #13 /app/wp-content/themes/webgravity/index.php(3): Illuminate\View\View->render() #14 /app/wp-includes/template-loader.php(106): include('/app/wp-content...') #15 /app/wp-blog-header.php(19): require_once('/app/wp-include...') #16 /app/index.php(17): require('/app/wp-blog-he...') #17 {main} Next Illuminate\View\ViewException: The asset manifest [/app/wp-content/themes/webgravity/public/build/manifest.json] cannot be found. (View: /app/wp-content/themes/webgravity/resources/views/partials/front-page/logos.blade.php) (View: /app/wp-content/themes/webgravity/resources/views/partials/front-page/logos.blade.php) in /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php:122 Stack trace: #0 /app/wp-content/themes/webgravity/vendor/illuminate/view/Engines/PhpEngine.php(60): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(Illuminate\View\ViewException), 1) #1 /app/wp-content/themes/webgravity/vendor/illuminate/view/Engines/CompilerEngine.php(75): Illuminate\View\Engines\PhpEngine->evaluatePath('/app/wp-content...', Array) #2 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(209): Illuminate\View\Engines\CompilerEngine->get('/app/wp-content...', Array) #3 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(192): Illuminate\View\View->getContents() #4 /app/wp-content/themes/webgravity/vendor/illuminate/view/View.php(161): Illuminate\View\View->renderContents() #5 /app/wp-content/themes/webgravity/index.php(3): Illuminate\View\View->render() #6 /app/wp-includes/template-loader.php(106): include('/app/wp-content...') #7 /app/wp-blog-header.php(19): require_once('/app/wp-include...') #8 /app/index.php(17): require('/app/wp-blog-he...') #9 {main} thrown in /app/wp-content/themes/webgravity/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php on line 122

If you use only sage, without bedrock, you should set path started with /wp-content/, eg.:
base: '/wp-content/themes/your-theme-name/public/build/',


I had it set, but its not working.

Ok, as I invastigated it’s not problem with base path. Path starts with /app/ because of using Lando. On previous version of sage is working good.

Summary:

  • I use only sage (no bedrock)
  • I downloaded sage main branch today because I wanted to use tailwind v4
  • I use Lando
  • Manifest is not generating when run dev
  • when run dev got error: yarn run v1.22.22
    $ vite
    node:fs:2345 return binding.writeFileUtf8( ^Error: ENOENT: no such file or directory, open ‘public/hot’
  • If I create public folder manually error disappears, but manifest is not generated
  • assets (images, fonts) are cloned to public/build/assets, but when use asset() got wrong url

I have no idea whats wrong :slight_smile:

Maybe still too early to use dev version of sage & acron?

In your description above I don’t see run build. You might need to run that first to generate the manifest

run dev doesn’t generate manifest? :open_mouth:

I attach vite config, manifest.json (which is generated only in run build), and error in console because image is 404.

Zrzut ekranu 2025-02-4 o 13.52.31

On run dev:

Try using {{ Vite::asset() }} to access your hashed images.

This was suggested by @cspicuzza in the roots discord

Unfortunately not working… :frowning: Still the same errors

I just did a quick test setup using a standard wp project. This is what worked for me:

  • Edit vite.config.js
    base: '/wp-content/themes/sage/public/build/'

  • Add a .env at the root directory of the theme and set the local dev url as the app path:
    APP_URL=https://example.test

  • Add an image to my resources/images directory

  • Run npm run build command

  • Add this to a view:
    <img src="{!! Vite::asset('resources/images/logo.svg') !!}" alt="">

  • Run npm run dev

1 Like

Works! thanks :slight_smile:

I have not set APP_URL, and Vite::asset should have “resources”