【问题标题】:laravel heroku Vite manifest not found at: /app/public/build/manifest.jso在以下位置找不到 laravel heroku Vite 清单:/app/public/build/manifest.json
【发布时间】:2022-08-02 18:52:27
【问题描述】:

在 Heroku 中上传我的 Laravel 项目后说“Vite manifest not found at: /app/public/build/manifest.json”

它在 localhost 中完美运行,但在 Heroku 中无法正常运行。

这是问题的预览

https://res.cloudinary.com/wanis4007/image/upload/v1656872417/Screenshot_2022-07-03_211622_ohzgs5.png

我在将项目推送到 Heroku 之前运行此代码

npm install
npm run dev
npm run build

有什么建议吗?

    标签: laravel npm heroku vite


    【解决方案1】:

    好的,解决方案是在部署之前将 nodejs 和 php buildpacks 添加到项目中(您也可以在部署后执行此操作,但您必须重新部署项目)

    heroku buildpacks:set heroku/php
    heroku buildpacks:set heroku/nodejs
    

    并使用此代码确保您的项目中有两个构建包(php 和 node js)

    heroku buildpacks
    

    注意:您可以在设置部分添加带有 heroku 仪表板的构建包

    【讨论】:

    • 嗨 Solayman Mousa,我在添加第一个模块时出错,即 heroku buildpacks:set heroku/app 错误:找不到模块'@heroku/buildpack-registry',你能帮我解决这个问题吗?谢谢
    【解决方案2】:

    我修好了我的:

    这个解决方案的灵感来自 zneharks

    $ heroku plugins:install buildpack-registry
    $ heroku plugins:install buildpacks  
    

    Solution of zneharks

    【讨论】:

      猜你喜欢
      • 2022-12-23
      • 2022-12-22
      • 2020-03-28
      • 2021-04-27
      • 2022-11-10
      • 2022-10-05
      • 2022-08-09
      • 1970-01-01
      • 2023-01-02
      相关资源
      最近更新 更多