0

Build-generated static files are not loading after deploying laravel app to vercel, I tried different vercel.json "routes" options found in various responses and those didn't work:/ My output in vercecl is set to "/api" ( otherwise deployment fails ). Here's verccel settings file:

vercel.json:

{
    "version": 2,
    "framework": null,
    "functions": {
        "api/index.php": { "runtime": "[email protected]" }
    },
    "builds": [
        { "src": "/public/**", "use": "@vercel/static" }
    ],
    "routes": [
        {
            "src": "/(css|js|vendor|assets|build)/(.*)",
            "dest": "public/$1/$2"
        },
     {
        "src": "/(.*)",
        "dest": "/api/index.php"
    }    ],
    "env": {
        "APP_ENV": "production",
        "APP_DEBUG": "true",
        "APP_URL": "wieniolaravel.vercel.app",

        "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",
        "VIEW_COMPILED_PATH": "/tmp",

        "CACHE_DRIVER": "array",
        "LOG_CHANNEL": "stderr",
        "SESSION_DRIVER": "cookie"
    }
}

app console errors

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.