Deployment - Script startup exceeded CPU time limit


I’m attempting to deploy an application. I’ve added Cloudflare to the config with the following:

export default defineConfig({
  output: "server",
  adapter: cloudflare({
    mode: "directory"

This was working fine, however, this now errors with:

16:35:33.547	03:35:33 PM [build] Server built in 6.99s
16:35:33.548	03:35:33 PM [build] Complete!
16:35:33.594	Finished
16:35:33.595	Found Functions directory at /functions. Uploading.
16:35:34.997	✨ Compiled Worker successfully
16:35:35.093	Found _routes.json in output directory. Uploading.
16:35:35.119	Validating asset output directory
16:35:35.742	Deploying your site to Cloudflare's global network...
16:35:39.616	 Uploading... (15/15)
16:35:39.619	✨ Success! Uploaded 0 files (15 already uploaded) (0.44 sec)
16:35:40.186	✨ Upload complete!
16:35:41.813	Success: Assets published!
16:35:44.312	Error: Failed to publish your Function. Got error: Error: Script startup exceeded CPU time limit.

How can I debug/optimise the boot of the application to resolve this issue?

I upgraded to the Workers paid plan and it hasn’t helped.