Relative Content

Tag Archive for next.js14

Next.js routing: catch-all except api requests

In my next.js app (app routing) I need custom route handling on the client. What I am doing is [[...route]]/page.tsx. The problem with this is that all api/ requests are landing to this page. I wish api would take a priority over wild card route, but it does not seem to be the case. I appreciate any ideas.

Next.js 14 all pages built as dynamic

Summary I have layout.tsx <body> <AppRouterCacheProvider> <NotistackProvider maxSnack={3}> <SessionProvider> <Stack> <Providers>{children}</Providers> </Stack> </SessionProvider> </NotistackProvider> </AppRouterCacheProvider> </body> when I build the app, static & dynamic pages created as expected; However, I need to add a <Header/> server component with sign-in & sing-out logic. Layout.tsx become <body> <AppRouterCacheProvider> <NotistackProvider maxSnack={3}> <SessionProvider> <Stack> <Header /> <Providers>{children}</Providers> </Stack> </SessionProvider> […]

Why am I getting a 404 Page Not Found error in my Next.js 14 application?

I am encountering a 404 error, along with the correct content, in my Next.js 14 application. I have checked the folder structure, but I still don’t understand what the problem is. If I route to other pages, they work fine and do not show any errors. The problem occurs only when loading the home page.

Next.js 14 Conversion & Server-side vs. Client-side Conditional

We’ve lost our primary frontend developer and I’m having to step in midway through an upgrade from Next.js 12 to Next.js 14. I’m not particularly proficient in either version and I’ve long struggling identifying code meant for server-side rendering vs. client-side rendering. This is exasperated by the introduction of the app router we’ve begun moving towards.

To pass data from a child function to a parent function using the action attribute in Server Actions next.js 14

This is a very simplified version. But the essence of the problem is that, during the form check, if the field is not filled in, I want to display
error text over the input. And to do this, I need to get the error text from the catch (error) function CreateTitle to the parent
function FormErrorAction to then pass this text to < p > </p >. And also I need to get id from CreateTitle.
` const FormErrorAction = () => {