Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

assets in Symfony6 – manifest.json missing

I’m learning Symfony, following a tuto. Problem is, it is with Symfony5 and i’m using Symfony6.
The tuto says to create an assets folder in public directory, which I did :

structure

When I use Twig to call my bootstrap.css like this :
<link href="{{ assets('assets/css/bootstrap.min.css' )}}" rel="stylesheet">

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I get this error :
An exception has been thrown during the rendering of a template ("Asset manifest file "/Applications/MAMP/htdocs/laboutiquefr/public/build/manifest.json" does not exist. Did you forget to build the assets with npm or yarn?").

My questions are :

  • How do I fix this manifest.json error ?
  • I see an assets folder with Symfony6, which is not on the tuto with Symfony5. Should I use this folder instead ?

Thank you very much.

>Solution :

You need to build asset when updating css/js/images by using the command:

yarn encore dev --watch when using yarn or npm run watch when using npm.

This should build your assets (and create a manifest.json referencing those assets).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading