Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-deploy production: Vite manifest not found at: /var/task/user/public/build/manifest.json #564

Open
agil3st opened this issue Jul 21, 2024 · 1 comment

Comments

@agil3st
Copy link

agil3st commented Jul 21, 2024

Bug report

Description

Auto-deploy using git push resulting error below:

Illuminate\View\ViewException:
Vite manifest not found at: /var/task/user/public/build/manifest.json (View: /var/task/user/resources/views/welcome.blade.php)

  at /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Vite.php:728
  at Illuminate\View\Engines\CompilerEngine->handleViewException(object(ViteManifestNotFoundException), 0)
     (/var/task/user/vendor/livewire/livewire/src/Mechanisms/ExtendBlade/ExtendedCompilerEngine.php:58)
  at Livewire\Mechanisms\ExtendBlade\ExtendedCompilerEngine->handleViewException(object(ViteManifestNotFoundException), 0)
     (/var/task/user/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:60)
  at Illuminate\View\Engines\PhpEngine->evaluatePath('/tmp/views/839bcec1d3afebf153f86eee6030524f.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag)))
     (/var/task/user/vendor/livewire/livewire/src/Mechanisms/ExtendBlade/ExtendedCompilerEngine.php:22)
  at Livewire\Mechanisms\ExtendBlade\ExtendedCompilerEngine->evaluatePath('/tmp/views/839bcec1d3afebf153f86eee6030524f.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag)))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:72)
  at Illuminate\View\Engines\CompilerEngine->get('/var/task/user/resources/views/welcome.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag)))
     (/var/task/user/vendor/livewire/livewire/src/Mechanisms/ExtendBlade/ExtendedCompilerEngine.php:10)
  at Livewire\Mechanisms\ExtendBlade\ExtendedCompilerEngine->get('/var/task/user/resources/views/welcome.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag)))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/View/View.php:207)
  at Illuminate\View\View->getContents()
     (/var/task/user/vendor/laravel/framework/src/Illuminate/View/View.php:190)
  at Illuminate\View\View->renderContents()
     (/var/task/user/vendor/laravel/framework/src/Illuminate/View/View.php:159)
  at Illuminate\View\View->render()
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Http/Response.php:69)
  at Illuminate\Http\Response->setContent(object(View))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Http/Response.php:35)
  at Illuminate\Http\Response->__construct(object(View), 200, array('Content-Type' => 'text/html'))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Routing/Router.php:918)
  at Illuminate\Routing\Router::toResponse(object(Request), object(View))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Routing/Router.php:885)
  at Illuminate\Routing\Router->prepareResponse(object(Request), object(View))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Routing/Router.php:805)
  at Illuminate\Routing\Router->Illuminate\Routing\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:144)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:50)
  at Illuminate\Routing\Middleware\SubstituteBindings->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:78)
  at Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49)
  at Illuminate\View\Middleware\ShareErrorsFromSession->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:121)
  at Illuminate\Session\Middleware\StartSession->handleStatefulRequest(object(Request), object(Store), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:64)
  at Illuminate\Session\Middleware\StartSession->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37)
  at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:67)
  at Illuminate\Cookie\Middleware\EncryptCookies->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119)
  at Illuminate\Pipeline\Pipeline->then(object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Routing/Router.php:805)
  at Illuminate\Routing\Router->runRouteWithinStack(object(Route), object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Routing/Router.php:784)
  at Illuminate\Routing\Router->runRoute(object(Request), object(Route))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Routing/Router.php:748)
  at Illuminate\Routing\Router->dispatchToRoute(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Routing/Router.php:737)
  at Illuminate\Routing\Router->dispatch(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:200)
  at Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:144)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php:19)
  at Livewire\Features\SupportDisablingBackButtonCache\DisableBackButtonCacheMiddleware->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31)
  at Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:40)
  at Illuminate\Foundation\Http\Middleware\TrimStrings->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27)
  at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:99)
  at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php:49)
  at Illuminate\Http\Middleware\HandleCors->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:39)
  at Illuminate\Http\Middleware\TrustProxies->handle(object(Request), object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119)
  at Illuminate\Pipeline\Pipeline->then(object(Closure))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(object(Request))
     (/var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144)
  at Illuminate\Foundation\Http\Kernel->handle(object(Request))
     (/var/task/user/public/index.php:51)
  at require('/var/task/user/public/index.php')
     (/var/task/user/api/index.php:4)    

Here is my vercel.json

{
    "version": 2,
    "framework": null,
    "builds": [
        { "src": "/api/index.php", "use": "[email protected]" }
    ],
    "routes": [
        {
            "src": "/(.*)",
            "dest": "/api/index.php"
        }
    ],
    "env": {
        "APP_ENV": "production",
        "APP_DEBUG": "true",
        "APP_URL": "https://mydomain.com",
        "VERCEL_DEMO_MODE": "true",
        "APP_CONFIG_CACHE": "/tmp/config.php",
        "APP_EVENTS_CACHE": "/tmp/events.php",
        "APP_PACKAGES_CACHE": "/tmp/packages.php",
        "APP_ROUTES_CACHE": "/tmp/routes.php",
        "APP_SERVICES_CACHE": "/tmp/services.php",
        "CACHE_DRIVER": "array",
        "LOG_CHANNEL": "stderr",
        "SESSION_DRIVER": "cookie",
        "VIEW_COMPILED_PATH": "/tmp/views",
        "SSR_TEMP_PATH": "/tmp/ssr",
        "NODE_PATH": "node"
    }
}

Did I missed something?

@nadar
Copy link

nadar commented Sep 2, 2024

add this to your composer.json

"scripts": {
        // .... other laravel default scripts
        "vercel": [
          "npm ci && npm run build"
        ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants