[next 14.0.4] Getting Server Actions error from non server actions request/response (Working on Chromium, not for Safari or FireFox) #59105
Replies: 43 comments 22 replies
-
i have the same error, but for now all my component are client
|
Beta Was this translation helpful? Give feedback.
-
same here
|
Beta Was this translation helpful? Give feedback.
-
I have the same issue while using
|
Beta Was this translation helpful? Give feedback.
-
Also getting this error: |
Beta Was this translation helpful? Give feedback.
-
Same issue for me |
Beta Was this translation helpful? Give feedback.
-
Also having the same issue. "Error: Failed to find Server Action "null". This request might be from an older or newer deployment. Original error: Invariant: Missing 'next-action' header." Unsure how to resolve it. |
Beta Was this translation helpful? Give feedback.
-
Add this to header and try again. It worked for me:
|
Beta Was this translation helpful? Give feedback.
-
same error i got Error: Failed to find Server Action "c44e2f10789ec4c5fbc4dad37671bce191042615". This request might be from an older or newer deployment. Original error: Invariant: Couldn't find action module ID from module map. |
Beta Was this translation helpful? Give feedback.
-
I have the same error in a nextjs 14.1.0 project. |
Beta Was this translation helpful? Give feedback.
-
Yep I'm getting the same problem:
|
Beta Was this translation helpful? Give feedback.
-
Getting the same error after deploying to next 14.1.0
|
Beta Was this translation helpful? Give feedback.
-
Same thing here, next 14.1.0, using a component with "use client" and <Script/>:
Maybe this is an “internal bug” ? |
Beta Was this translation helpful? Give feedback.
-
Same Error
|
Beta Was this translation helpful? Give feedback.
-
Okay, this was the issue for me personally. I was writing a server actions file. Which then I converted into a standard REST API route. I forgot to remove the "use server" tag. |
Beta Was this translation helpful? Give feedback.
-
Hi there. Pretty new to web dev so if you think of a better solution please share. What solved the problem for me was adding "preventDefault()" and "location.reload()". My next.config.js file is using default settings, I didn't change anything there ( I tried, but it didn't work for me).
|
Beta Was this translation helpful? Give feedback.
-
Same. 14.0.4 |
Beta Was this translation helpful? Give feedback.
-
Many forget to switch from onSubmit to "action" when using a form; this might help. |
Beta Was this translation helpful? Give feedback.
-
I hade the same exact problem, |
Beta Was this translation helpful? Give feedback.
-
This is happening for me for a completely empty nextjs project with only the default Tried the following things to get rid of it but nothing worked:
I don't even have any server actions defined yet. It also happens in an infinite loop and creates thousands of log statements saying Does anyone else have the same issue as me? Has anyone been able to figure this out? This seems like an extremely critical bug to me, why has the NextJS team been ignoring it for 3+ months since it was first reported? |
Beta Was this translation helpful? Give feedback.
-
I was getting that same "Missing 'next-action' header" error with Next 14.1.3. Then I discovered that I was passing a bad URL to axios (due to a missing env variable) in one of my server actions. Once I fixed the axios request, the error went away and it works fine. |
Beta Was this translation helpful? Give feedback.
-
This is probably not the answer for everyone. |
Beta Was this translation helpful? Give feedback.
-
I use next 14.1.2 App Router. when I was using next-auth v5 to implement user login in my app, I got the error message you guys mentioned here.
I call signIn to do login in my customized form, but I get above error message. It shows "HTTP/1.1 404 Not Found" when I check the http response using Fiddle. I am sure to implement route.ts under /api/auth/[...nextauth] correctly.
|
Beta Was this translation helpful? Give feedback.
-
Same issue, is not reproducible every time but happens...
And happens only on prod |
Beta Was this translation helpful? Give feedback.
-
Same issue. Next version 14.1.4 |
Beta Was this translation helpful? Give feedback.
-
my case is resolved by fixing api usage, but it looks like there's several cases which occurs and it turned out that 'working on chrome/chromium' looks like bug, or chromium handles/modifies request. |
Beta Was this translation helpful? Give feedback.
-
I believe this is related to undici |
Beta Was this translation helpful? Give feedback.
-
In my case i think it's related to internationalization. I highly suspect it doesn't like the The solution of adding a import { Domains } from "..."
import createMiddleware from "next-intl/middleware"
const intlMiddleware = createMiddleware({
locales: Domains?.map(({ defaultLocale }) => defaultLocale),
defaultLocale: "us",
domains: Domains,
localePrefix: "never",
timeZone: "Europe/Madrid"
})
const middleware = req => {
// GET DEFAULT LOCALE
const host = req.headers.get("host")
const { defaultLocale = "us" } = Domains.find(({ domain }) => domain === host)
req.cookies.set("NEXT_LOCALE", defaultLocale)
// APPLY TRANSLATION MIDDLEWARE
return intlMiddleware(req)
}
export default middleware
export const config = {
matcher: ["/", "/((?!api|_next|_vercel|.*\\..*).*)"]
} This started appearing after switching to the |
Beta Was this translation helpful? Give feedback.
-
am still getting the error in my log , the discussion is closed but still cannot find a solution, should i consider it as a bug or what am i supposed to do ? |
Beta Was this translation helpful? Give feedback.
-
well i created a new one here since this one is closed --> #64214 |
Beta Was this translation helpful? Give feedback.
-
Edited at Dec, 11. 2023, after tested with 14.0.4
Summary
What I want to implement
(1) service: request with authorization request (on same tab or popup) with return URL parameters passed
(2) third party: do authorization process -> open page of return URL with result
(3) service: check result and doing rest job
Return component (at current status)
Client Component
Errors i got and what i did
This is first error message i got from return url
After search, i found #58295 #58019
I found that
So, I
which made error changed into
So, I added
to server component but it shows same error.
As this is not a server-actions component, what should I do to resolve this?
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions