Getting an error: "Failed to find Server Action "4a68...". This request might be from an older or newer deployment." #58431
Replies: 53 comments 50 replies
|
Getting the same in local dev on 14.0.0 up to 14.0.5 canary 5 for any server action which is triggered from client component. Working: Doesnt work: |
|
@leerob this seems to be a problem, but we don't have the ability to make a repro repo because it requires multiple deployments to reproduce. can you please look into this or address? |
|
I am experiencing the same problem as well. In my application if I log out in one tab and then trigger a server action in the other tab I get this error every time. |
|
I also got this now using next 14.0.4. For me it happens when the server actions is called from an parallel intercepted route. The exact same code works fine from the actual route. |
|
In my case it happens when trying to redirect on successfully submitted form. where: error: By the way, anyone has an approach to onFormSubmission side effects, and is willing to share? I am working with native useFormState, gave it a ride, and it's missing a bit in flexibility or I can't wrap my head around on Next.js 14 specifics yet EDIT: EDIT2: |
|
I'm getting the same error. The full error message: Error: Failed to find Server Action "ff338b32de2c62c9fce3998a34545a3e0672f704". This request might be from an older or newer deployment. Original error: Invariant: Couldn't find action module ID from module map.The stack I'm using: It happens whenever the user's JWT token expires and Tanstack Query tries to refetch the data on the background. All of my query/mutation functions are Server Actions. In them, I have this code running before actually fetching anything: // serverAuth lives in another file
export const serverAuth = async () => await getServerSession(authOptions);
// actual Server Action
'use server';
const getUnitPractitioners = () => {
const session = await serverAuth();
if (!session) {
LOG.error('🚨 No session found when fetching practitioners for this unit');
return Promise.reject(
'No session found when fetching practitioners for this unit'
);
}
// does whatever action is necessary
return data;
} |
|
I'm experiencing the same issue |
|
Same issue on both stable and canary releases for Re-echoing that it appears to occur when using the Client Components data fetching paradigm. |
|
I have same problem. old code: image |
|
Same issue here. Happens when i reopen intercepted modal window that uses server actions in client components using browser navigation. |
|
Same issue here. |
|
Same here "next": "^14.1.0", Error: Failed to find Server Action "572c475e1c59eeb141374e2737137c179e2063dc".
This request might be from an older or newer deployment. Original error: Invariant: Couldn't find action module ID from module map.
at t3 (/.../node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:39:1693)
at /.../node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:38:7079
at AsyncLocalStorage.run (node:async_hooks:338:14) |
|
Any updates facing same issue ? |
|
I get a similar error when I use react-email... |
|
I have this exact same issue. |
|
If you still encounter it with latest Next.js version, please file an issue with reproduction, we can help take a look on it! 🙏 |
|
I installed 14.2.10 and I'm still getting Scenario: a user opens a tab, and then the server has a new deployment while the tab is not refreshed i.e. it becomes outdated / stale; in this case if the user Submit (with server action) using the stale client, the server action returns I tried this pattern: import server actions using relative path in a server component, and pass it as a prop to a client component, but it does not work Referenced from #58431 (reply in thread) and #58431 (comment) The specific behavior on my un-refreshed tab is: when clicking Submit, it fired a POST server action with header So from the Dev console we can see an uncaught error saying "reading xxx from undefined", also the user would see no changes from the page (because the response seems to be the exact HTML structure of the current page). In this case if the user chooses to refresh the tab, then it can work, but not every time the users are aware of this, obviously. So I'm wondering how can I maybe detect this kind of response (server action returning |
|
from the nextjs docs: https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#security:~:text=However%2C%20for%20this,a%20specific%20build. If this is the constraint, we can work around this by having an api route serve the build id to the frontend, and the frontend can poll for the build id. If it sees any changes, we can ask the user to refresh the page |
|
This feature of generating new "unguessable, non-deterministic IDs" for server actions on every build is ruining the ability to continuously deploy my application. I don't want to force my users to refresh their browsers every time I do a deploy. What's the solution for self-hosters? Can this feature be turned off? |
|
We are self-hosting Next.js on Cloud Run. We have set the NEXT_SERVER_ACTIONS_ENCRYPTION_KEY, but that made no difference. This error is still popping up all the time. Is there anything that can be done? |
|
I toggled client component to the server component (APP CRASHED) and to the client component again (!!) and everything had been OK. |
|
We have set the NEXT_SERVER_ACTIONS_ENCRYPTION_KEY but still we run into |
|
Also running into this on 14.2.33, after switching to a standalone build. What is the deal with this? This is severely breaking our UX. |
|
Currently facing this issue on 15.1.4, hosting in Docker on ECS |
|
For me it was a browser issue. Hard reloading the browser, worked just fine. |
|
I feel like for me the issue is that there's other stuff running on the ECS, and whenever those get deployed, they restart Next.js application, which seems to break Server Actions. Might be wrong though. Basically, Next.js needs like ideal environment with nothing interrupting it. |
|
Getting this issue at all the time on Next I've even set |
|
Did someone figure out a solution for this , without using client functions? |
|
Does this issue occur if we don't use any server action? |
|
To anyone facing this issue, while self hosting Next.js, please try adding NEXT_DEPLOYMENT_ID or deploymentId to next.config.ts/js. According to official documentation here, this helps in version skewing protection. I have added this and so far, I'm not seeing issues as i was earlier |



Uh oh!
There was an error while loading. Please reload this page.
I recently deployed an App dir 14.0.1 Nextjs application and have several users using it at my company. It uses server actions heavily. This AM i started getting some errors in Sentry:
My assumption is that my users haven't refreshed their browser since I pushed out some changes.
Anyone ever seen anything like this? Any ideas or tips? Should I push out some change that makes users refresh when a new release is out?
All reactions