Questions tagged [next.js13]
339 questions
3
votes
3 answers
Where do custom components go in Next.js 13 file structure?
With this version, are you meant to create a Components/ folder inside the app folder? Or can I add new components anywhere in the file structure?
I currently have a components/ folder nested inside the app/ which seems to work fine. But I'm not…

Nick Kotte
- 69
- 5
3
votes
3 answers
CSS Modules not applying style - next.js 13
Using next.js 13.1.1 with /app
I've been doing all of my styles through a global.css up until now, but I'm trying to migrate them into CSS Modules.
In my root layout.js, I have a Header component that imports from ./header.js. This works fine with…

ChaosCantrip
- 41
- 1
- 4
3
votes
2 answers
Nexts.js 13 + Supabase > What's the proper way to create a user context
I'm building an app with Next.js 13 and Supabase for the backend, and I've been stuck on figuring out the best/proper way to go about creating a context/provider for the current logged in user.
The flow to retrieve the user from Supabase is…

Ryan Roberts
- 318
- 1
- 4
- 12
2
votes
2 answers
How to grant access for webview app only to middleware - next.js
How can I grant access for only mobile devices can access to middleware in nextjs ?
Because I want to handle some DOMs for a webview app, for desktop web, I want it to directly go to index page without go through middleware.
I'm using Next version…

MinhDat
- 57
- 3
2
votes
1 answer
Next.js 13.4: useEffect and State Not Updating in Client-Side Component
I encountered an issue in Next.js 13.4. When I created a Next.js project using the command npx create-next-app@latest, and then followed the steps, I encountered a problem with a Counter component. I created a file called Counter.tsx inside the…

7Codo - Ayoub
- 21
- 1
2
votes
1 answer
How to bind server actions api data in jsx in next.js 13.4
I have a server component in next.js 13.4 and on first load I am calling an api to get the data of weather, it is working fine.
Now I want to change the city using a form input. Which I am doing using server actions. But how to update the data of…

Umair Jameel
- 1,573
- 3
- 29
- 54
2
votes
1 answer
Next.js with Clerk Auth - how to detect if a user just signed up?
Using Clerk Auth, I have a working login/sign-up flow with Next.js 13 middleware.
When a user signs up, I want to add a row to my DB's Users table.
The problem with middleware is that it runs on every single request and I don't want to make a call…

PGT
- 1,468
- 20
- 34
2
votes
1 answer
useEffect not running in nextJS 13.4 (app router) app
i am trying to fetch data from next api route but the useEffect method is not firing up on page reload.
also i can't make this component async as nextJS does'nt allow async functions on client components(use client)
page.tsx:
"use client";
import {…

Warrior
- 23
- 4
2
votes
1 answer
style is not loading properly when page loads
I'm using keen-slider@6.8.5 in a next@13.4.7 project. When my page loads in initial state of loading before javascript load finishs, I get this result image before loading properly and when it's load finishes, I get this result which is fine imae…

Ali Asadollahi
- 31
- 10
2
votes
2 answers
In next.js 13, layout.tsx was specified separately, but the problem of components in the root layout appearing
The Header component should not appear in this RegisterLayout, but the header component in the root layout is still visible. what did i do wrong?
RegisterLayout.tsx
import "../globals.css";
import ContentCard from…

gndy Br
- 51
- 2
2
votes
0 answers
Frequent 'EBUSY' errors using NextJS 13's built-in fetch
Since migrating from NextJS 12 to 13.4.9 and from axios to the now built-in fetch, I've started frequently getting EBUSY errors on the server side. These don't seem to break anything at first glance:
Failed to update prerender cache for…

Mr. Rulix
- 21
- 3
2
votes
0 answers
In Nextjs 13 (app router), how to use generateStaticParams with Firebase (Firestore) to generate dynamic pages?
I have build a listing page that lists down all the firestore docs (coffeeplaces) from the firestore database, and when I click on one of them, I want to show an indiviual page with information about that specific place.
But I have some difficulties…

Bart
- 149
- 1
- 16
2
votes
1 answer
Confused about passing data between server and client in next.js
I'm having trouble understanding the correct way of handling data exchange between server-side and client-side components in NextJS 13.
I'm trying to understand this by creating the simplest scenario possible. I have these two functions that simply…

Cirrocumulus
- 520
- 3
- 15
2
votes
2 answers
Using next-auth & next-intl in middleware together?
I don't know how to use 'next-auth/middleware' and 'next-intl/middleware' together in the middleware. Next-auth gets exported as default and it's a must... on the other hand Next-intl creates a middleware and add a separate config...
export {…

Wali ahmed
- 21
- 2
2
votes
2 answers
Tab freezes when using browser forward button for page accessed via Link
I have a minimal Next.JS app with two pages: a home page and a dashboard page. I have an nav bar at the top of all pages with a Link object that links to the dashboard page. When I click the Link and arrive at the dashboard page, I press the browser…

lost_in_the_source
- 10,998
- 9
- 46
- 75