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

Vercel not detecting .vercel_build_output (svelte-kit) when building with turbo #208

Closed
Fedeorlandau opened this issue Dec 12, 2021 · 5 comments

Comments

@Fedeorlandau
Copy link

Fedeorlandau commented Dec 12, 2021

What version of Turborepo are you using?

1.0.6

Describe the Bug

For some reason Vercel is not detecting the .vercel_build_output content and generating the serverless functions/routes/static files accordingly.

I've set up 2 projects on Vercel using the same repository, one is building the frontend app with svelte-kit and the other one with turborepo. Check the screenshots:

Expected Behavior

To get Vercel detecting the build generated by turbo.

To Reproduce

Without turbo With turbo
image image
As you can see, vercel is detecting the .vercel_build_output content The adapter is generating the folder but not detecting the content afterwards
Without turbo With turbo
image image
Website running fine image
{
    "private": true,
    "name": "test",
    "workspaces": [
        "apps/*"
    ],
    "scripts": {
        "frontend:prod": "yarn workspace frontend build",
        "backend:prod": "yarn workspace backend build && yarn workspace backend start:prod",
        "bootstrap": "rimraf node_modules && yarn && yarn start"
    },
    "devDependencies": {
        "rimraf": "^3.0.2",
        "turbo": "^1.0.6"
    },
    "turbo": {
        "baseBranch": "origin/main",
        "pipeline": {
            "build": {
                "dependsOn": ["^build"],
                "outputs": [".vercel_build_output/**", ".svelte-kit/**"],
                "cache": false
            },
            "test": {
                "dependsOn": ["^build"],
                "outputs": []
            },
            "lint": {
                "outputs": []
            },
            "dev": {
                "cache": false
            },
            "frontend#deploy": {
                "dependsOn": ["frontend#build"]
            }
        }
    }   
}

Thank you!

@jaredpalmer
Copy link
Contributor

Set turbo to run from the root directory with something like: cd ../.. && npx turbo run build —scope=<app> —includeDependencies

@Fedeorlandau
Copy link
Author

Fedeorlandau commented Dec 12, 2021

@jaredpalmer hi there, thank you for your answer.

I'm running it from the root directory. If you check the screenshot above you'll see the that root directory is "./".

I've tried to turbo run build -scope=frontend -includeDependencies but the result is the same.

The .vercel_build_output is there but vercel is not doing anything with it:

This is what is missing from the pipeline with turbo

Detected Serverless Functions in ".vercel_build_output"
--
19:05:10.888 | Detected Static Assets in ".vercel_build_output"
19:05:10.888 | Detected Routes Configuration in ".vercel_build_output"

Thanks

@Fedeorlandau
Copy link
Author

Fixed it. I've changed a few things.

image

Thank you for your work. Turbo is amazing.

@jaredpalmer
Copy link
Contributor

You can remove build output and install commands, I think vercel should infer those and solve the problem

@Fedeorlandau
Copy link
Author

You're 100% correct. Thank you again.

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

No branches or pull requests

2 participants