Home > Software engineering >  RESOLVE - Problem when using assets from database in symfony
RESOLVE - Problem when using assets from database in symfony

Time:06-29

I have a little problem when I use an asset.

error capture

In my database I have the link of videos which are stocked in my server and for example one of them is : Commande/test/a/2362022a.mp4, the right path of the file is myProject/public/Commande/test/a/2362022a.mp4 So I try to do this :

<video controls>
    <source src="{{ asset(commande.lienVideo)}}" type="video/webm">
</video>

But I have this error :

An exception has been thrown during the rendering of a template ("Asset manifest file "/var/www/html/app_brobro/public/build/manifest.json" does not exist. Did you forget to build the assets with npm or yarn?").

I also try this, but I have got the same error :

<video controls>
    <source src="{{ asset('/' ~ commande.lienVideo)}}" type="video/webm">
</video>

I hope someone will have a solution to this ^^

Thanks by advance and have a nice day !

CodePudding user response:

According to our exchanges in comments here is your solution:

As the official Symfony documentation specifies here, you have to build your Webpack with yarn dev by default or npm run build if you prefer npm to manage your front dependencies.

So just run one of them and that's it !

  • Related