我在学习Symfony,跟着一段教程。问题是,它与Symfony5有关,而我正在使用Symfony6。tuto说要在公共目录中创建一个资产文件夹,我这样做了:

当我使用Twig像这样调用我的bootstrap.css时:<link href="{{ assets('assets/css/bootstrap.min.css' )}}" rel="stylesheet">
我得到了一个错误: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?").
我的问题是:
非常感谢。
发布于 2022-06-02 10:35:17
在更新css/js/映像时,需要使用以下命令构建资产:
使用纱线时使用yarn encore dev --watch,在使用npm时使用npm run watch。
这将构建您的资产(并创建引用这些资产的manifest.json )。
https://stackoverflow.com/questions/72474353
复制相似问题