Skip to content

cf worker build issue with 2.39.0 - start time too long #14430

@zhihengGet

Description

@zhihengGet

Describe the bug

CF build failed after update to 2.39.0 - previously with 2.38.1 it was <300ms

https://developers.cloudflare.com/workers/platform/limits/#worker-startup-time

2.39.0: > 500ms startup time and > 1000kb for 2 server chunks with remote-* as prefix

Reproduction

it is hard to reproduce because of large project -.-

  • bun run build (also theres 2 server chunk >1000kb in 2.39.0)
  • wrangler deploy

Logs

17:26:16.478	  To ensure fast responses, there are constraints on Worker startup, such as how much CPU it can use, or how long it can take. Your Worker has hit one of these startup limits. Try reducing the amount of work done during startup (outside the event handler), either by removing code or relocating it inside the event handler.
17:26:16.478	  
17:26:16.478	  Refer to https://developers.cloudflare.com/workers/platform/limits/#worker-startup-time for more details
17:26:16.478	  A CPU Profile of your Worker's startup phase has been written to .wrangler/tmp/startup-profile-h8gYuH/worker.cpuprofile - load it into the Chrome DevTools profiler (or directly in VSCode) to view a flamegraph.
17:26:16.478	
17:26:16.478	
17:26:16.497	
17:26:16.498	✘ [ERROR] A request to the Cloudflare API 
17:26:16.498	
17:26:16.498	  Error: Script startup exceeded CPU time limit.
17:26:16.498	   [code: 10021]
17:26:16.498	
17:26:16.498	  
17:26:16.498	  If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose
17:26:16.498	
17:26:16.498

System Info

cloudflare

Severity

blocking

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions