Questions tagged [nextjs13]

1277 questions
-1
votes
1 answer

How to automatically get user data when accessing the website in nextjs 13?

Can nextjs 13 automatically get user data when accessing the website with accessToken in localStorage? I use nextjs 13 to create a website but i don't know what component i can put get user data code inside. I am a beginner. Pls help me
-1
votes
0 answers

Is there any reason why data is not parsing in this server side function

I am trying to parse data from the client to the server, but somehow I'm getting undefined for the data. Can you give your thought on why this is behaving this way? const handler = async (req, res) => { const {data} = req.body; if…
Xhris
  • 55
  • 7
-1
votes
1 answer

Custom metadata tags Nextjs 13

Is there a way to create custom metatags with next 13 and control if it should be “name” or “property”? I was trying to add some Facebook metatags like ‘og:updated_time’ , but that key isn’t there and using ‘other’ doesn’t work since it uses ‘name’…
Lucas
  • 17
  • 2
-1
votes
1 answer

next.js 13 useSession() doesn't retrieve session info when i refresh

I am making ecommerce site clone using nextjs 13 and in its order page i call useSession(from next-auth/react) to see whether user signed in or not. At first time i visit the page through link navigation there is no problem but when i refresh or i…
-1
votes
1 answer

Getting a TypeError: Cannot read properties of undefined (reading 'current') on Next.js

TypeError: Cannot read properties of undefined (reading 'current') I'm getting this error upon running a nextjs project for the first time. This is the command I'm running: npx create-next-app@latest my-test-app --typescript --tailwind…
JLLGZ
  • 1
  • 2
-1
votes
1 answer

Nextjs 13 Bootstrap navbar toggle doesn't work (App directory version)

I could not run the bootstrap navbar collapse feature in nextjs 13. I have tried many ways: 1.I added bootstrap js codes with script by opening head tag. 2. I added it to the layout page. it didn't work despite all this. how can i make this collapse…
-1
votes
2 answers

TypeError: Cannot read properties of undefined (reading 'headers') in Next Js 13

I am working on a jwt authentication system in next js 13 with redux toolkit. I have a Django backend and it is communicating with my next js frontend. The problem is in the communication between API page in next js and the redux toolkit to set the…
victor
  • 134
  • 1
  • 9
-1
votes
1 answer

How to set cookie headers in NextJS13

I am trying to serialize the refresh and access tokens from my endpoint and save them as cookies but they return undefined. Here is my code: import { NextRequest, NextResponse } from "next/server"; import cookie from "cookie"; …
-1
votes
2 answers

Can't run Chakra UI with Next.js 13

I was looking the Chakra UI installation with Next.js 13 from the attached link and I believe did it completely. However, when I saved my file afterwards, I noticed that the automatic page did not refresh and I encountered a hydration error in…
onurhan
  • 37
  • 7
-1
votes
1 answer

Issue with Next.js useProviders returning null for authentication providers in Nav component

I m trying to make a nextjs website and im using provider in that but my provider is showing null al the time i tried to debug it with the help of bard and chatgpt but was helpless. This is my Nav.jsx code and in this i have error with provider,the…
-1
votes
1 answer

How can I access query in api routes in app directory of next js.As I want to do pagination by querying my requested url

enter image description here I am getting squiggly lines below query saying Property 'query' does not exist on type 'Request'. enter image description here This is my blog component Along with answer, Could someone provide an example of their work…
-1
votes
2 answers

can nextjs server component loading be deferred?

currently doing some development on a personal project that can potentially become SaaS application. The application currently uses firebase authentication on the frontend using nextJs 13+. I have all the required component protected. The issue is,…
Lee
  • 73
  • 1
  • 5
-1
votes
1 answer

Why Next Js 13 JSON.parse is returning string it would return object

can anyone tell me why type of dbJson returning string it should return object export async function POST(req: Request) { const data = (await req.json()) as { type: "print" | "view" | "save" }; let db = await ReadDb(); let dbJson =…
-1
votes
1 answer

when to use pages and app folder in nextjs

I'm new in Nextjs13 and I'm confused in pages and app directory can you clear me when we must to create page in pages folder andapp folder? If I don't use pages and build and export the project for deploying I can't see .html files in out folder I…
-1
votes
1 answer

Is there any simplest way to create graphql server in next13 without using any toolkit (apollo, grafbase,graphql-yoga)

I am trying to make the graphql server in next 13 without using any toolkit like apollo, grafbase,graphql-yoga. Just pure graphql server. But i am getting the error in the browser:Failed to load resource: the server responded with a status of 405…
Kirti
  • 1
  • 1