GGT_APP_CRASH but I don't understand why
Hello, my app crashes sometimes and I've never managed to understand why. I'd love some help on this.
- app: getsimio
- environment: production
- traceId: 43e1e1bf38adb3e15a09e042a187d186
21 Replies
I'm looking into this
I do see where the errors are happening but not the cause
Does this happen quite frequently?
Hello, yes it happened 288 times in the last 30 days
It happened again a few minutes ago fbe6bce46e274d3f5bc00b9cab70a93d
Looking into this now
The last trace seems to have finished successfully
I looked at the background action and there were no failures
Let me dig some more because your app logs don't seem to be really telling me anything
I don't see any GGT_APP_CRASH logs in the timespan around the error either
I just see a bunch of timeouts
I see a few different kinds of errors. Is there anywhere in your application where you're calling multiple actions in a chain?
action1 > action2 > etc?
What typically happens when you see
[GraphQL] GGT_TRANSACTION_TIMEOUT: Can't commit a transaction after it has timed out
is that you have an action at the top of the call stack that timed out and the other actions after it continued to run. The transaction would therefore be closed when trying to run the rest
^ thats just one example/possible explanation of what might be happeningAlright. It looks like the issue might be caused by some throttling we do for apps that get really high traffic. The feature was removed yesterday for most apps (not yours). Before we can remove it for your application, you need to change your usage of
Promise.all
on line 23 of getCampaignStatsBetweenDates
.
Instead please use the p-map package (@^4.0.0) with concurrency set. https://www.npmjs.com/package/p-mapnpm
p-map
Map over promises concurrently. Latest version: 7.0.3, last published: 4 months ago. Start using p-map in your project by running
npm i p-map
. There are 2510 other projects in the npm registry using p-map.Its our general rule of thumb that you use p-map instead of Promise.all whenever possible. Promise.all doesn't allow for concurrency settings which p-map does
Your fetch all promise all might make more sense as sequencial fetches. The problem that Gadget/you might face because of pagination is a heap out of memory issue
Ok I've changed it into sequential fetches
But my deployment crashed :/
81e8bd4ef3d82987cab401717aef8687

Interesting
Could you please send me the trace for that?
Yes 81e8bd4ef3d82987cab401717aef8687
there are also 4 new packages, maybe it's that :/
"@sentry/node": "^9.12.0",
"@sentry/react": "^7.0.0",
"@sentry/tracing": "^7.120.3",
"@sentry/vite-plugin": "^3.3.1",
Thats definitely possible but let me double check
I'm honestly wondering if its tailwind related
oh
I have to dig some more
Just based on the errors that I see in the trace, it smells of tailwind but I want to be sure
Ok, I'm not sure what it is but this
node_modules/antd/es/alert/index.js
and other logs like it are the issue
This is the utility that's causing the issue: [--btn-bg:theme(colors.pink.500)]
Or it would appear to be
The initial error I see is from that package that I shared but from the deploy log it looks to be specifically the theme usage
Wonder if you get the same error from redeploying or if something else will throwI feel that I've seen those errors since the beginning [--btn-bg:theme(colors.pink.500)]
I try another deployment
reading online about oom errors with vite build I'm wondering if it could be vite configs that need to be change as well
The last deployment: 75559e099c9ddcec5c383b6b733acd67
Not sure about this one
It failed?
You might have to disable the sourcemapping: https://github.com/storybookjs/builder-vite/issues/409#issuecomment-1152848986
GitHub
[Bug] JavaScript heap out of memory (Vite build works, Storybook w/...
What version of vite are you using? ^2.9.12 System info and storybook versions System: OS: Linux 5.10 Ubuntu 21.10 21.10 (Impish Indri) CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor Binaries: N...

Ok i deploy the changes 2729b02877f423c843645827140f3041
And it worked?
We'll see
Oh nice!
Sourcemapping was the issue
We turned off the throttling for your application as well btw
Great! Thank you very much Antoine