Skip to content

ERROR Script startup exceeded CPU time limit. #664

@miguelrk

Description

@miguelrk

I keep getting ERROR Script startup exceeded CPU time limit. error when doing bunx nuxthub deploy because of the postgres() function call, but that should work. The following is what is throwing the error in a server endpoint server/api/push/index.post.ts. Strange thing is the code used to work, and now it does not.

import postgres from 'postgres'

export default defineEventHandler(async (event) => {
  const runtimeConfig = useRuntimeConfig()

  // ...

  if (!runtimeConfig.databaseUrl) {
    throw createError({ statusCode: 500, statusMessage: 'Database URL not configured' })
  }
  const sql = postgres(runtimeConfig.databaseUrl) // THIS LINE CAUSES THE ISSUE

  // ...
})

VERSIONS: @nuxt/ui@4.0.0, nuxt@4.1.2 and @nuxthub/core@0.9.0.

Any help or insight is greatly appreciated 🙏🏼

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions