Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with vite-flavored Sage: The asset manifest cannot be found. #31

Open
joshuafredrickson opened this issue Feb 6, 2025 · 3 comments

Comments

@joshuafredrickson
Copy link

Just starting to dive in on the new Sage/vite combo, and because there's no manifest.json during yarn dev, the following error triggers:

[previous exception] [object] (Roots\\Acorn\\Assets\\Exceptions\\ManifestNotFoundException(code: 0): The asset manifest [/site/wp-content/themes/sage/public/build/manifest.json] cannot be found. at /site/wp-content/themes/sage/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php:122)
[stacktrace]
#0 /site/wp-content/themes/sage/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php(95): Roots\\Acorn\\Assets\\Manager->getJsonManifest('/Volumes/Crucia...')
#1 /site/wp-content/themes/sage/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php(71): Roots\\Acorn\\Assets\\Manager->resolve('theme', Array)
#2 /site/wp-content/themes/sage/vendor/roots/acorn/src/Roots/helpers.php(20): Roots\\Acorn\\Assets\\Manager->manifest('theme')
#3 /site/wp-content/themes/sage/vendor/log1x/sage-svg/src/SageSvg.php(104): Roots\\asset('images/logo.svg', 'theme')
#4 /site/wp-content/themes/sage/vendor/log1x/sage-svg/src/SageSvg.php(69): Log1x\\SageSvg\\SageSvg->asset('images/logo.svg')
#5 /site/wp-content/themes/sage/vendor/log1x/sage-svg/src/SageSvg.php(48): Log1x\\SageSvg\\SageSvg->getContents('images/logo.svg')
#6 /site/wp-content/themes/sage/vendor/log1x/sage-svg/src/helpers.php(16): Log1x\\SageSvg\\SageSvg->render('images.logo', 'w-16', Array, Object(Illuminate\\Support\\Collection))
#7 /site/wp-content/cache/acorn/framework/views/4c9f681a017d9e8e1a92bccbd2e7b65e.php(8): get_svg('images.logo', 'w-16', Array)
...

This may be more of an upstream issue with how acorn handles manifests.

@Log1x
Copy link
Owner

Log1x commented Feb 8, 2025

I think my changes in roots/acorn#432 should fix this.

@Log1x
Copy link
Owner

Log1x commented Feb 8, 2025

Might need to remove https://github.com/Log1x/sage-svg/blob/master/src/SageSvg.php#L96-L102 though 👀

@Log1x
Copy link
Owner

Log1x commented Feb 24, 2025

This now works with Acorn dev-main but you will have to add resources to your paths:

- @svg('images.logo')
+ @svg('resources.images.logo')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants