Questions tagged [app-router]

116 questions
1
vote
1 answer

Clerk Auth - GET http://localhost:3000/ 401 (Unauthorized) - 401 Loop after Signin/Signout

Good day, I have been trying to setup Clerk on Next lastest version with the app the App router. I have went through the well written docs and it seem pretty straighforward to setup so I gave it a shot on a new project I have been working on. I have…
1
vote
0 answers

Why is Next.js not revalidating specific tags with on-demand revalidation?

i'm currently trying out new Next.js 13's app router. I'm on next@13.4.4. I'm trying to create dashboard so user can manage languages. I have problem with revalidation of fetch inside dynamic page. I've got server component LanguagePage that fetches…
puchmertl
  • 31
  • 5
1
vote
2 answers

How can I upload images to an Amazon S3 bucket using Next.js 13's app router and overcome API route structure changes?

How to upload images to amazon s3 bucket on nextjs13 using app router? I tried using formidable and multer but both soltions are not working as nextjs changes their api routes structure: import { NextRequest, NextResponse } from…
1
vote
1 answer

Localhost redirected you too many times NextJs 13 and JWT verify middleware

Everything works perfectly fine one problem is that when I am logged In I am redirected to "/" page and if a user wanna go to "/login" or "/register" page even after being logged In they should be redirected to "/" page how can I add that feature in…
Bipin
  • 53
  • 4
1
vote
2 answers

What's the alternative to pages/_app.js in app router in NextJS?

I am just starting with NextJS and there is a new router called app router. Now I have some tutorials using pages/_app.js from the NextJS page router. So, what's the corresponding file for that in the app router?
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
1
vote
3 answers

Next.js App Routing Behaves Differently After Deployment to Netlify

I'm currently developing a Next.js app (version 13.4.1) and have encountered an issue with the new App Routing feature. In my local development environment, everything works as expected, but once deployed to Netlify, I'm experiencing different…
Liren Yeo
  • 3,215
  • 2
  • 20
  • 41
1
vote
1 answer

nextjs 13.4 app router , APIs endpoint POST , can't json() "parse" the request to access the body

export async function POST(req:Request) { try { const body = await req.json() console.log(body); return new Response("ok") } catch (error) { console.log(error); } } when using postman to send a payload , the server…
Fadlo
  • 41
  • 5
1
vote
1 answer

Polymer observers in app-drawer-template. Understanding routing

After starting polymer app with polymer init cli command. You've given a template with some basic setup of an application. It also includes routings setup. If you open my-app.html You can see following:
Pol
  • 24,517
  • 28
  • 74
  • 95
0
votes
0 answers

Persisting state and context on locale change in nextjs 13 and next-intl

I am building a nextjs (v13) app routed website that uses next-intl for internationalization. I am trying to figure out a way to have some context and state persist on locale change. When locale is changed on the page, useRouter is triggered to…
0
votes
0 answers

Is it possible to have 2 arrays inside a
tag along other fields? FieldArray Formik Yup

So Im using Next.Js 13 AppRouter with TypeScript, I'm trying to have allergiesName as an array and medicalConditonsName as well. The thing is that the documentation says to use FieldArrays, but FieldArrays must be outside of the Form tag? From what…
Inzen
  • 21
  • 4
0
votes
1 answer

Nextjs 13 App Router: I can't import a module to my client component

My Code: "use client" import vine from "@vinejs/vine"; //cause problem export default function Test() { return <> } Error: Failed to compile node:dns/promises Module build failed: UnhandledSchemeError: Reading from "node:dns/promises" is not…
work
  • 33
  • 1
  • 9
0
votes
1 answer

How to use relative path 'fetch' in NextJs App Router?

I'm trying to fetch data using fetch("/api/status"), but it only finds URL when I use the absolute path: fetch("http://localhost:3000/api/status") . Without using your path saved in a variable.
0
votes
0 answers

Nextjs.13 API fetching, with prisma connection to create a user

I am facing a problem with fetching /api/user in nextjs.13 // @/app/page.tsx "use client"; import { FormEvent } from "react"; export default function Home() { async function handlePost(event: FormEvent) { …
0
votes
0 answers

How to add conditional rendering based on URL in next.js rootlayout for app router v13.4?

What I am trying to achieve I have a header that I need to change based on specific urls The issue rootlayout doesn't allow me to conditionally render import "./globals.css"; import localFont from "@next/font/local"; import Header from…
Ritik Jangir
  • 87
  • 2
  • 11
0
votes
0 answers

Next-auth in Next13 app router returns unexpected responses on signIn

Using Next-Auth in Next13 app router behavios unexpectedly. I used "next": "13.4.13", "next-auth": "^4.23.1", in my projext for authentication. I uses credentials provider for signin and on sucessfull signin using username and password the signin…