failed deployment with no details
Recently my deployments keep failing with no logs or information. I am building my react app with vite in GitHub actions and using the wrangler action to deploy. The action reports success but on the dashboard it says failed.
Here’s one of the deployment IDs: b28e7166-295c-492b-af25-f97a22ec546f
It seems like it started after I added the react email package, but I’m not sure. It works fine locally so I don’t know why it wouldn’t work when deployed.
Any thoughts?
11 Replies
Hey there! Sorry about the lack of messaging on this one. It's hitting Script startup exceeded CPU time limit.
If you have any other questions, please do let us know.
I am parsing some json from a confit file that is bundled in. It’s a const that I just declared and initialized at the top of the pages file (outside of a request handled). Would this do it?
I will try moving it into the handler and see if it fixes the issue
yeah you're doing too much in the global scope, do that in your handler and you should be good
Checking back and it looks like they started failing before I added that json stuff in the global scope.
Here is the first deployment that it started having issues. Do you mind checking if it’s the same error?
1af16fe4-bdab-46e2-afe1-40fffb3026af
And here is the render method I’m using. In a little concerned that maybe since it’s trying to SSR it could be causing different issues?
https://react.email/docs/utilities/render
Error: Script startup exceeded CPU time limit.SSR itself is fine, I do it in a bunch of sites without issue This failure is just having too much in the global scope that it's taking too long for the script to even start up
I am home now and tested. It deploys fine if I change the
<Text>This is a test email</Text>
to <>This is a test email</>
. Seems like the react email components are causing the issue but im not sure why since its not in the global scope
Hey @Walshy | Deploying, I have been doing some more digging and noticed that the size of the react email stuff is very large.
About 4M combined. Would importing these into the worker be causing this error?
I tried importing them into the request function instead like this:
But that didn't resolve it and im not sure if thats how it works anyways. Do you think I could be on the right path?
![No description](https://cdn.answeroverflow.com/1238003153010429983/image.png)
![No description](https://cdn.answeroverflow.com/1238003599393685574/image.png)
Not sure if this is helpful or not. I was using wrangler-action GHA to deploy to cloudflare and it wasn't giving any errors. So I tried connecting my git repo directly in cloudflare to deploy via cloudflare (instead of using GHA and wrangler-action). There, it told me that it couldn't deploy to cloudflare's global network because 'Your Functions script is over the 1 MiB'.
Here is the full output it gave me:
I have to use the GitHub action to deploy because my app has multiple instances with different configs, and the GitHub integration with cloudflare only allowed one project per repo
Gotcha. My suggestion wasn't a permanent change but purely to get more error output.
I switched back to using GitHub action afterwards
It seems the wrangler GitHub action doesn't see errors beyond a certain stage of deployment. This particular error shows up at the "deploying to cloudflare global network" stage, which happens right at the end of deployment