redwood: [Bug?]: RedwoodJS Deploy to Vercel with a vercel.json in the project causes the deploy to loop for 10minutes on vercel

What’s not working?

This is my vercel.json

{
  "functions": {
    "api/src/functions/minutesync/minutesync.*": {
      "memory": 256,
      "runtime": "@vercel/redwood@2.0.7"
    },
    "api/src/functions/asauth/asauth.*": {
      "memory": 512,
      "runtime": "@vercel/redwood@2.0.7"
    },
    "api/src/functions/ascallback/ascallback.*": {
      "memory": 128,
      "runtime":"@vercel/redwood@2.0.7"
    },
    "api/src/functions/asrefresh/asrefresh.*": {
      "memory": 256,
      "runtime":"@vercel/redwood@2.0.7"
    },
    "api/src/functions/bulksync/bulksync.*": {
      "memory": 128,
      "runtime":"@vercel/redwood@2.0.7"
    },
    "api/src/functions/graphql.*": {
      "memory": 512,
      "runtime":"@vercel/redwood@2.0.7"
    }
  }
}

My project config is defaults for a redwoodjs project on RedwoodJS@6.6.4.

With the vercel.json the build keeps looping again and again for 8-10 minutes and then eventually succeeds

Without the vercel.json the build succeeds in 1m30s

I’m guessing Vercel’s default config for RedwoodJS projects is somehow being overridden by my vercel.json, causing this looping behaviour.

How do we reproduce the bug?

Create a new project with RedwoodJS typescript and setup a vercel deploy. Add a vercel.json to the project with some config for the functions.

What’s your environment? (If it applies)

System:
    OS: Windows 10 10.0.19045
  Binaries:
    Node: 18.19.0 - ~\AppData\Local\Temp\yarn--1708063642733-0.2390738274290265\node.CMD
    Yarn: 1.22.17 - ~\AppData\Local\Temp\yarn--1708063642733-0.2390738274290265\yarn.CMD
  Browsers:
    Chrome: 121.0.6167.185
    Edge: Chromium (121.0.2277.112)
  npmPackages:
    @redwoodjs/core: 6.6.4 => 6.6.4

Are you interested in working on this?

  • I’m interested in working on this

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Reactions: 2
  • Comments: 16 (6 by maintainers)

Most upvoted comments

It appears that targeting the root graphql file only will allow you to customize options for the server file but not the nested functions. Building will succeed with this configuration

{
  "functions": {
    "api/src/functions/*.*": {
      "maxDuration": 20,
      "runtime": "@vercel/redwood@2.0.5"
    }
}

Attempting to set options for a nested function will result in recursive builds

{
  "functions": {
    "api/src/functions/*.*": {
      "maxDuration": 20,
      "runtime": "@vercel/redwood@2.0.5"
    },
    "api/src/functions/nestedFunction/*.*": {
      "maxDuration": 300,
      "runtime": "@vercel/redwood@2.0.5"
    }
  }
}

I have verified this both with the local vercel build command and in the platform builds.

This restricts customization and pretty much rules out vercel as viable platform for all but the most simple apps built with redwood.

For context I am also running "@redwoodjs/core": "6.6.0"

Hi @jtoar, I’m running into the same issue here trying to extend my function timeouts.

The selection of the runtime is referenced in the docs here. It seems this was suggested by vercel support to a user in this community post.

As it stands, the default deploy that runs the @redwood/vercel builder is not picking up the maxDuration property being exported from my functions so function executions are limited to 15 seconds even on the Pro plan.

Hey @RinKimLaw I tried making a repro (albeit with just the graphql function) and couldn’t reproduce 8-10 minute looping builds. One thing I’m wondering: is the @vercel/redwood package a Vercel runtime? Basically, where did you see docs to use that package as the runtime, or did Vercel support tip you off to that?

I’m wondering if that’s the problem. I feel like maybe you should actually end up using the Node.js runtime via @vercel/node?