@vercel/node + Turborepo issue

Hi everyone! I’m trying to deploy my first application using Turborepo and a bit different combination of tools provided by Vercel. My scenario is, usually I’ve been using @vercel/node and a simple Express application to serve static HTML pages using the file below:

{
  "builds": [
    {
      "src": "index.js",
      "use": "@vercel/node"
    },
    {
      "src": "public/**",
      "use": "@vercel/static"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "index.js"
    }
  ]
}

And my Turborepo file looks like this:

{
  "$schema": "https://turborepo.com/schema.json",
  "ui": "tui",
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "env": ["GOOGLE_ANALYTICS", "SANITY_API", "SANITY_DATABASE", "SANITY_PROJECT"],
      "inputs": ["$TURBO_DEFAULT$", ".env*"],
      "outputs": ["dist/**"]
    },
    "lint": {
      "dependsOn": ["^lint"]
    },
    "check-types": {
      "dependsOn": ["^check-types"]
    },
    "dev": {
      "cache": false,
      "persistent": true
    }
  }
}

I’m honestly a bit lost on the way I can make sure I still can serve my compiled index.js with tsup in a Turborepo application, happy to provide some further examples and things if needed, this is a really uncomon practice since I just love deploying Express applications that serves HTML (using Twig and static HTML + CSS files).

If you’re having trouble deploying an Express app, this guide can help.

You can also ask v0 for suggestions tailored to your own project setup.

Hi :waving_hand: in addition to the link above, I’d also suggest: Express 101: Everything about deploying your Express app on Vercel

FYI - if you are just serving static files, you don’t need to run your own server. If you plan on using templating languages then something like Express will be necessary, but otherwise you may be able to serve your static content directly from our edge network.

Hi Phil! I’m definitely using Express, but once it’s running on top of TurboRepo it seems the @vercel/node configuration gets completely ignored serving the file directly as text, I’m using the Vercel support to check my issue as well, so let’s see if we can have it fixed somehow or if I’m doing something too crazy/wrong. It’s just odd that even when outputing properly the vercel.json configuration doesn’t match.

Following up on this, I managed to have it working after reaching out to the support. I still have some issues with my project, but I’ll share in an open source project soon. :slight_smile: Thanks for the help!

Is there anything you can share about the fix or the config that ended up working? Just to help the next person that comes across here