FULL TURBO -> blank site

When the vercel build runs turbo and we get a “FULL TURBO” message, the resulting site is completely blank. The html on the page that is shown does not contain svelte’s app.html, but rather the default vite start page (see https://tilly-styles-m935l6pr3-norsktest.vercel.app/)

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite App</title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/main.js"></script>
  </body>
</html>

If I redeploy everything works as expected.

Any idea where I should start looking…?

Missing assets when hitting cache usually means that the outputs key for the task is missing some of the files that need to be captured in caching. Can you share your turbo.json?

4 Likes

Here is the vercel.json file for the package:

{
    "framework": "sveltekit-1",
    "outputDirectory": ".",
    "rewrites": [{ "source": "/(.*)", "destination": "/" }]
}

and here is the complete turbo.json (I’m assuming there are easier ways to handle env vars, but listing them all silenced some warnings).

{
    "$schema": "https://turbo.build/schema.json",
    "ui": "stream",
    "globalDependencies": [
        ".env",
        ".env.public"
    ],
    "globalEnv": [
        "ABLY_API_KEY",
        "AUTH_SECRET", "AUTH_TRUST_HOST",
        "AUTH_GITHUB_ID", "AUTH_GITHUB_SECRET",
        "AUTH_LINKEDIN_ID", "AUTH_LINKEDIN_SECRET",
        "AUTH_FACEBOOK_ID", "AUTH_FACEBOOK_SECRET",
        "AUTH_SENDGRID_KEY",
        "COREPACK_ENABLE_STRICT",
        "curdir",
        "DATABASE_URL", "DATABASE_URL_UNPOOLED", 
        "EDGE_CONFIG",
        "PGDATABASE", "PGHOST", "PGHOST_UNPOOLED", "PGHOST_UNPOOLED", "PGPASSWORD", "PGUSER",
        "POSTGRES_URL", "POSTGRES_URL_NON_POOLING", "POSTGRES_URL_NO_SSL", "POSTGRES_PRISMA_URL", "POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_HOST", "POSTGRES_DATABASE",
        "POSTGRES_PROD_URL", "POSTGRES_STAGING_URL",
        "PUSHER_APPID", "PUSHER_KEY", "PUSHER_SECRET", "PUSHER_CLUSTER",
        "SENTRY_ORG", "SENTRY_PROJECT", "SENTRY_DSN", "SENTRY_AUTH_TOKEN",
        "SURVEY_URL",
        "TURBO_REMOTE_ONLY", "TURBO_RUN_SUMMARY",
        "YERBU_SECRET", "CI", "TILLY_STYLES"
    ],
    "tasks": {
        "db:push": {
            "cache": false
        },
        "build": {
            "inputs": [
                "$TURBO_DEFAULT$",
                ".env",
                ".env.public"
            ],
            "dependsOn": ["prepare", "^build"],
            "outputs": [".svelte-kit/output/**", "./vercel/output/**"]
        },
        "dev": {
            "inputs": [
                "$TURBO_DEFAULT$",
                ".env",
                ".env.public"
            ],
            "cache": false,
            "persistent": true
        },
        "preview": {
            "dependsOn": ["build"],
            "outputs": [".svelte-kit/output/**"]
        },
        "test": {
            "dependsOn": ["build"],
            "outputs": ["./coverage/**", "./coverage/junit.xml"]
        },
        "prepare": {
            "inputs": ["src/**/*.config.[jt]s"],
            "outputs": [".svelte-kit/tsconfig.json"]
        },
        "lint": {},
        "lint:fix": {},
        "lint:js": {},
        "lint:js:fix": {},
        "lint:style": {},
        "lint:style:fix": {}
    }
}