You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Laravel 9 Breeze生产环境登录注册失效,提示Vite manifest未找到

Laravel 9 Breeze生产环境登录/注册功能失效(Vite清单文件缺失)

生产环境错误:未找到Vite清单文件,路径:/home/codarhqc/codar/public/build/manifest.json (视图:/home/codarhqc/codar/resources/views/layouts/guest.blade.php) (视图:/home/codarhqc/codar/resources/views/layouts/guest.blade.php)

解决方案

  • 生成生产环境静态资源
    在项目根目录执行生产构建命令,生成Vite所需的清单文件与编译后资源:

    npm run build
    

    执行完成后,public/build目录会自动生成manifest.json及对应静态文件。

  • 修复文件权限
    确保Web服务器能读取public/build目录及文件,执行权限调整命令:

    chmod -R 755 public/build
    chown -R www-data:www-data public/build
    

    注:www-data为常见Web服务器用户,若你的服务器使用apache等其他用户,需对应替换。

  • 验证Vite配置
    检查项目根目录的vite.config.js,确认构建输出路径和清单配置正确:

    import { defineConfig } from 'vite';
    import laravel from 'laravel-vite-plugin';
    
    export default defineConfig({
        plugins: [
            laravel({
                input: [
                    'resources/css/app.css',
                    'resources/js/app.js',
                ],
                refresh: true,
            }),
        ],
        build: {
            outDir: 'public/build',
            manifest: true,
        },
    });
    
  • 清除框架缓存
    清除Laravel视图与配置缓存,避免旧引用导致问题:

    php artisan view:clear
    php artisan config:clear
    

内容的提问来源于stack exchange,提问作者Mayor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 05:15:41