Question

Function exceeded limit in deployment - following structure of Typescript example?

Hi, I am trying to deploy a Typescript + Fastify API to Digital Ocean Functions. I have referred to the example typescript repo: https://github.com/digitalocean/sample-functions-typescript-helloworld and have structured my project in the same manner.

My structure is as follows:

functions
│   ├── packages
│   │   └── api
│   │       └── crud-api
│   │           ├── package.json
│   │           ├── package-lock.json
│   │           ├── schema.sql
│   │           ├── src
│   │           │   ├── config
│   │           │   │   └── supabase.ts
│   │           │   ├── index.ts
│   │           │   ├── middleware
│   │           │   │   ├── auth.ts
│   │           │   │   ├── validate.ts
│   │           │   │   └── validation.ts
│   │           │   ├── routes
│   │           │   │   ├── auth.ts
│   │           │   │   ├── <hidden>.ts
│   │           │   │   ├── <hidden>.ts
│   │           │   │   ├── <hidden>.ts
│   │           │   │   ├── <hidden>.ts
│   │           │   │   └── <hidden>.ts
│   │           │   ├── services
│   │           │   │   ├── <hidden>.ts
│   │           │   │   └── <hidden>.ts
│   │           │   ├── types
│   │           │   │   └── index.ts
│   │           │   └── utils
│   │           │       ├── auth.ts
│   │           │       ├── logger.ts
│   │           │       └── storage.ts
│   │           ├── tsconfig.dev.json
│   │           └── tsconfig.json
│   └── project.yml

My project is very straight forward, CRUD endpoints to a database with less than 100 entries.

The result of doctl serverless deploy functions --remote-build

Deploying '/home/my-project/functions'
  to namespace 'fn-****-****-****-****-********'
  on host 'https://faas-lon1-****.doserverless.co'
Submitted function 'api/my-api' for remote building and deployment in runtime nodejs:18 (id: 972732c8a3d64c4fa732c8a3d63c4f46)
Processing of action 'api/my-api' is still running remotely ...
Processing of action 'api/my-api' is still running remotely ...
Processing of action 'api/my-api' is still running remotely ...
Processing of action 'api/my-api' is still running remotely ...
Processing of action 'api/my-api' is still running remotely ...
Processing of action 'api/my-api' is still running remotely ...
Processing of action 'api/my-api' is still running remotely ...
Processing of action 'api/my-api' is still running remotely ...
Processing of action 'api/my-api' is still running remotely ...
Processing of action 'api/my-api' is still running remotely ...
Processing of action 'api/my-api' is still running remotely ...

Failures:
Error: While deploying action 'api/my-api' (running remote build): The function exceeded its time limits of 120000 milliseconds.

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
May 6, 2025

Hi there,

Looks like your function hit the 120-second build time limit during remote build.

This usually happens when your dependencies are large or the build process is too complex for the remote builder.

You can check the official limits here: 👉 https://docs.digitalocean.com/products/functions/details/limits/ (“The maximum build time for remote builds is 2 minutes.”)

Try to trim the dependencies in package.json (especially dev deps).

Also have you tried using a local build instead?

As a last resort, you could try to break the app into smaller functions if possible.

If it still fails, contacting DigitalOcean Support could help you troubleshoot further.

- Bobby

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.