首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >缺少Symfony6 - manifest.json中的资产

缺少Symfony6 - manifest.json中的资产
EN

Stack Overflow用户
提问于 2022-06-02 10:01:52
回答 1查看 567关注 0票数 1

我在学习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?").

我的问题是:

  • 如何修复这个manifest.json错误?
  • --我看到一个带有Symfony6的资产文件夹,这不是Symfony5的tuto文件夹。我应该使用这个文件夹吗?

非常感谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-02 10:35:17

在更新css/js/映像时,需要使用以下命令构建资产:

使用纱线时使用yarn encore dev --watch,在使用npm时使用npm run watch

这将构建您的资产(并创建引用这些资产的manifest.json )。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72474353

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档