-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read properties of undefined (reading 'call') #70703
Comments
@JClackett Thank you for submitting an issue! I was not able to replicate the issue when deployed on Vercel.
Is the |
@samcx Not all the time no, it seems to happen very sporadically for me. yeah but what is .call() being called on in this webpack file? for example, in: f[e].call(n.exports, n, n.exports, l), f[e] could be returning undefined. |
@JClackett Can you share a screenshot (or recording) when you receive this error? Not able to replicate it even sporadically. |
I used to get the same error randomly when using redirect in a server action. I have never been able to reproduce 100%. In my case, it's in a form. I store data in DB and then redirect to form next page B, then it sometimes throw, and when it does I need to refresh the page A, and click again to go to next form page B. EDIT:
|
Same for me. It's very random... |
I also get this issue a lot in Sentry, I have never been able to reproduce it myself. Running Next.js 14.2.15 |
I have seen this too with server actions (just regular server actions invoked as a result of a user action). And it seems to be correlated with a new deployment to Vercel. Every time a new deployment happens, a few of these pop up in Sentry. |
@JClackett Do you have Skew Protection enabled on Vercel (could be related to when a new Deployment is created) by any chance? |
@samcx Yeah skew protection is enabled but its only for 12 hours right, which in the scheme of user sessions is nothing, and especially that they only get new versions if they navigate to another route on the old version right? They could leave a tab open over night come back to work, submit an action, and it's already out of date - so it's kind of not very useful sometimes. I guess I can only deploy during the day and hope that everyone clicks a link and gets the latest version, but that seems pretty loose as a general strategy. Is there no way to route actions to the new deployment or something, to force users onto the new version. I dont even have that many monthly users relative to big companies (5k) and seeing this in Sentry very often - can't imagine what it's like with 100k users? is this just a limitation of server actions? can they not be tagged somehow so they have the same ID across deploys given certain criteria (similar to api routes' url)? I get that this could happen if I defined a regular API route, but at least the path is static, and I can handle backwards compatibility, so it should never error given I handle this properly - but in server actions it just blows up and I have 0 control. Looking for advice here as it's super confusing. |
To help you pinpoint this issue, this this is the part of the source code where this happens. It's on line 17. As others have reported, it happens just before invoking the server action. I have seen this with users that had the page open for a while (like a week), and there were deployments in the meantime.
|
Link to the code that reproduces this issue
https://github.com/JClackett/next-server-actions
To Reproduce
Getting this consistently in production only and only for certain users
I posted an issue a while back and am still struggling to get a repro, but it's consistently happening. I can see its happening on certain actions but when I test those in production it doesnt error, so im assuming its something to do with a user's browser maybe?
#67208
Looking into the sources there's one webpack file generated and there are 2 references to .call
and
I can see from the session replays that the server action isnt even being called, it throws an error on the client straight away as soon as the form is submitted.
Current vs. Expected behavior
Server actions dont throw exceptions
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000 Available memory (MB): 32768 Available CPU cores: 8 Binaries: Node: 18.20.4 npm: 10.7.0 Yarn: 1.22.19 pnpm: 8.15.7 Relevant Packages: next: 14.2.14 // Latest available version is detected (14.2.14). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: 5.6.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Navigation, Runtime, Webpack
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed)
Additional context
Deployed on vercel, production only.
The text was updated successfully, but these errors were encountered: