Questions tagged [next.js13]
339 questions
4
votes
1 answer
Next.js error in production mode - Digest: 1782794309
I use Next 13.4.3. I don't have an API folder in the app folder as described here, by default all pgaes.tsx etc. are in the app folder SSR: https://nextjs.org/docs/app/building-your-application/routing/router-handlers. In my main page /app/page.tsx…

Captai-N
- 1,124
- 3
- 15
- 26
4
votes
0 answers
Why is tag is not working properly when the content inside not-found.tsx file is being used in Next.js 13?
I have created a layout.tsx file where I included a tag that links to the root of my application ('/'). The tag works fine when I use it to navigate from an existing page (e.g., /about) to return to the home page. But when I am in the…

Anurag Nepal
- 41
- 2
4
votes
1 answer
Get request URL in NextJS server component inside the app folder
Is there a way to get the request object (NextRequest) or at least the request URL inside a server component (Page and/or layout components) using NextJS 13 and the new app directory?
I know how to do it in a client component, but I want to get it…

Vmxes
- 2,329
- 2
- 19
- 34
4
votes
1 answer
Next.js - next dev does not reflect changes in code
Im running thru some tutorials and after about an hour of searching, I cant seem to find a solution for this. Any changes I make to a specific component (navbar) is not being reflected in the dev server.
Im just trying to change and play around with…

RedFish
- 41
- 3
4
votes
2 answers
How to setup i18next with Next.js 13^ for server and client components
Next community, I am having trouble configuring my internationalization with the brand new Next.js13 I am also using i18next.
I kindly ask for your assistance and may be few examples of a working setup.
This is what I have tried so far
(I am using…

Aleksandar Hristov
- 340
- 3
- 13
3
votes
2 answers
Unable to delete cookie using Next.js server side action
I'm trying to delete a cookie using the next/headers module in a Next.js application, but it doesn't seem to work as expected. Here's the code snippet:
import {cookies} from "next/headers";
export default async function Signout() {
async…

hantoren
- 357
- 2
- 17
3
votes
1 answer
How to hide a component only on home navbar using next.js 13?
I'm finishing my undergraduate degree and creating a website as my course's final project to promote my research. I'm learning next.js just for this.
I have this sidebar in my layout.tsx, but I want to hide the "menuAlt" component only on the…

Ana Caroline Azevedo
- 33
- 4
3
votes
2 answers
How to add nonce to inline styles and scripts in Next.js?
Assuming Content-Security-Policy policy such as:
default-src 'self'; script-src https://ray.run
Next.js fails to function because of errors such as:
Refused to apply inline style because it violates the following Content Security Policy directive:…

Luc Gagan
- 301
- 9
3
votes
0 answers
How to use generateStaticParams with searchParams in Next.js 13 (app router) page?
Lets consider this example of fetching first 3 pages of pagination during build time:
app/listing-params/[page]/page.jsx
const getData = async (page) =>
new Promise((resolve) => {
setTimeout(() => {
resolve(`You are on page ${page}`);
…

Everettss
- 15,475
- 9
- 72
- 98
3
votes
0 answers
Is Next.js 13.4 cache and revalidate broken?
Fairly new to both Next and React. Please let me know if it's me or a bug?
I have the following Next 13.4.2 app:
Demo
/app/[id]/page.tsx
export const revalidate = 0;
export const fetchCache = "force-no-store";
export const dynamic =…

Miro
- 8,402
- 3
- 34
- 72
3
votes
1 answer
Module build failed: UnhandledSchemeError on Next.js 13 with sentry
I created Next.js 13 project with sentry(automated installation) and i did nothing on files but when it tries to compile file C:\Users\myuser\Desktop\Work\project\sentry.server.config.ts it seems like it skips character \ in path
Here is a full…

baechu
- 37
- 5
3
votes
0 answers
Next-Auth server-side signout request to api/auth/signout
I am using Next-Auth v4.22.1 and NextJS 13.
I am trying to sign out a user inside the [...nextauth].js jwt callback.
I know that signOut() is only available on the client side. If it is used on the server-side we will get a "ReferenceError: window…

Scottish Smile
- 455
- 7
- 22
3
votes
1 answer
Access domain & full path in next.js 13 server component
How can I access the domain name and full path in a server component in Next.js 13 using the app directory? In previous versions of Next.js (such as version 12), I could do this using context in the getServerSideProps function, but this is no longer…

Sohail
- 2,058
- 7
- 33
- 57
3
votes
5 answers
Next.js 13 with Ant Design 5: Components and Pages Render Before Styles Load, Causing Jump
I followed the antd and nextjs doc to config the project.
Added this code into the ./scripts/genAntdCss.tsx file:
import { extractStyle } from '@ant-design/static-style-extract';
import fs from 'fs';
const outputPath = './public/antd.min.css';
const…

Fatemeh Qasemkhani
- 1,942
- 1
- 15
- 25
3
votes
1 answer
Loading google font with Next.js in Bootstrap
I would like to load google font as described here: https://nextjs.org/docs/basic-features/font-optimization
If I'm following the docs and loading like this, it's all good:
import { Open_Sans } from '@next/font/google';
const openSans = Open_Sans…

levipadre
- 569
- 7
- 31