Error: Something went wrong with the request to Cloudflare... Script startup timed out. [API code: 10021]

Hello Cloudflare community, from last couple of days I am facing below mentioned error whenever I initialize local server by running wrangler dev

Note: its not permanent error, I mean if i run wrangler dev10 times then 2-3 times local server starts successfully.

Your expert response in awaited,


Are you doing a lot in the global scope of your Worker?

It sounds like it’s intermittently taking too long in that scope & timing out.

My code is build on top of templates provided by Cloudflare.
Its very simple app with prisma orm and 4 api i.e to perform crud operation.

notes: [
text: ‘Script startup timed out. This could be due to script exceeding size limits or
expensive code in the global scope.\n’ +
’ [code: 10021]’
location: undefined,
kind: ‘error’,
code: 10021

similar issue, did you ever figure this out?

Cloudflare is not being helpful and refuses to answer my support issues…