Skip to content

Commit d539c1c

Browse files
authored
[Workers] update validation errors (#25916)
* startup debugging notes are duplicated on limits page, just link there * add memory exceeded err
1 parent e49b5eb commit d539c1c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/content/docs/workers/observability/errors.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,11 @@ Specific error cases include but are not limited to:
209209

210210
#### Script startup exceeded CPU time limit
211211

212-
This means that you are doing work in the top-level scope of your Worker that takes [more than the startup time limit (400ms)](/workers/platform/limits/#worker-startup-time) of CPU time.
212+
This means that you are doing work in the top-level scope of your Worker that takes more than the [startup time limit (1s)](/workers/platform/limits/#worker-startup-time) of CPU time.
213213

214-
This is usually a sign of a bug and/or large performance problem with your code or a dependency you rely on. It's not typical to use more than 400ms of CPU time when your app starts. The more time your Worker's code spends parsing and executing top-level scope, the slower your Worker will be when you deploy a code change or a new [isolate](/workers/reference/how-workers-works/) is created.
214+
#### Script startup exceeded memory limit
215215

216-
This error is most commonly caused by attempting to perform expernsive initialization work directly in top level (global) scope, rather than either at build time or when your Worker's handler is invoked. For example, attempting to initialize an app by generating or consuming a large schema.
217-
218-
To analyze what is consuming so much CPU time, you should open Chrome DevTools for your Worker and look at the Profiling and/or Performance panels to understand where time is being spent. Is there something glaring that consumes tons of CPU time, especially the first time you make a request to your Worker?
216+
This means that you are doing work in the top-level scope of your Worker that allocates more than the [memory limit (128 MB)](/workers/platform/limits/#memory) of memory.
219217

220218
## Runtime errors
221219

src/content/docs/workers/platform/limits.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ If you are having trouble staying under this limit, consider [profiling using De
343343

344344
When you attempt to deploy a Worker using the [Wrangler CLI](/workers/wrangler/), but your deployment is rejected because your Worker exceeds the maximum startup time, Wrangler will automatically generate a CPU profile that you can import into Chrome DevTools or open directly in VSCode. You can use this to learn what code in your Worker uses large amounts of CPU time at startup. Refer to [`wrangler check startup`](/workers/wrangler/commands/#startup) for more details.
345345

346+
Exceeding this limit is most commonly caused by attempting to perform expensive initialization work directly in top level (global) scope, rather than either at build time or when your Worker's handler is invoked. For example, attempting to initialize an app by generating or consuming a large schema.
347+
346348
<Render file="limits_increase" product="workers" />
347349

348350
---

0 commit comments

Comments
 (0)