Questions tagged [next.js13]
Next.js 13 is a version of the Next.js JavaScript web development framework released on October 26, 2022 and includes support for layouts, React Server Components, streaming, data fetching, and Turbopack, a new Rust-based successor to Webpack. Use this tag only for questions specific to Next.js 13 and its features. For generic Next.js programming questions, the [next.js] tag should be used.
next.js13
3,529
questions
0
votes
0
answers
79
views
Nextjs 14 generateStaticParams doesn't generate files
I'm on NextJS 14 with the App router, and I'm using output: "export" to generate static files for production. I'm using the generateStaticParams function inside /[id]/page.tsx to export ...
0
votes
1
answer
62
views
NextJS app router dynamic routes not working with any named HTTP methods
This is the code placed inside /app/api/password/reset/confirm/[userId]/[idToken].ts.
import { NextRequest, NextResponse } from 'next/server';
// Define and export the GET handler
export const GET = ...
0
votes
0
answers
28
views
Node error while running npx create next app
I am trying to create a next project using npx but i am getting an error
npm error code ENOENT
npm error syscall lstat
npm error path C:\Users\LENOVO\AppData\Roaming\npm
npm error errno -4058
npm ...
0
votes
0
answers
34
views
How to revalidate current path in Next.js14?
I am rewriting code of a goal tracker app and moving from onSubmit to Server Actions
So basically user can add goals and groups of goals (Relationship, Financial, etc)
It's a simple one page app
...
0
votes
1
answer
46
views
How to combine the data of two state into third state in Next js
I am using useState to set a state I have collected data in two different states (that are text and inputs ) now I want to add both states into a third state (that is alldata)
I have tried
const [...
0
votes
0
answers
27
views
safeParse not working server sider with z.union() : Error: Attempted to call indexOf() from the server but indexOf is on the client
I am working on a next js app with the directory page system.
I have a folder called [[...options]], which enable to get url segments in the url, more details about that here
I would like parse the ...
0
votes
0
answers
41
views
How to enable CORS with NEXT 14 at Vercel?
I have an api endpoint, and I want it to be accessible from any domain name (everyone can use it from web on their domains).
import { NextApiResponse } from "next";
import { NextResponse } ...
0
votes
0
answers
38
views
Next JS app router importing static image problem
I'm currently using the app router in Next.JS. When importing images from the public server using the one below from a reusable component
<img src="assets/icon.png" />
It will import ...
0
votes
0
answers
55
views
Infinite scroll with scroll position and state restoration when navigating back
I'm working on a page with an infinite list, where each item is clickable and leads to a different route. I load 10 items in a server action, I scroll down, more items load. I click one of the items, ...
0
votes
0
answers
17
views
Change language using next intl
"use client";
import React, { useTransition } from "react";
import style from "@/app/components/header/header.module.scss";
import { useRouter } from "next/...
2
votes
1
answer
443
views
Best Way to Fetch Data in a Client Component in Next.js 14: useEffect with Route Handlers vs Async Server Action
I'm working on a Next.js 14 project and I need to fetch data in a client component. I've come across two different methods and I'm unsure which one is the best practice.
Method 1: useEffect with an ...
1
vote
1
answer
45
views
Conflict Between MetaMask and TrustWallet Connections Using Web3 in Next.js
Hello Stack Overflow community,
I have developed two separate applications using Next.js and Web3, one for MetaMask and another for TrustWallet. However, I'm encountering a problem where attempting to ...
0
votes
0
answers
47
views
Unable to get Cookie in nextjs that is set by laravel api in my browser?
I have a Next.js application where I am trying to set up Axios to include the CSRF token automatically in all non-GET requests. I have written the following code to retrieve the XSRF-TOKEN from ...
0
votes
0
answers
55
views
Issues with getServerSideProps and experimental-edge runtime on Cloudflare Workers with Next.js
I'm working on a Next.js project using version 13.5.6 and deploying it to Cloudflare Workers. I've set up my project to use the experimental-edge runtime for server-side rendering with ...
0
votes
1
answer
49
views
"metadata" is not a valid Next.js entry export value
when I install next.js 14 with typescript it will appear this error which is pointing to my meta data type!
import type { Metadata } from "next";
export const metadata: Metadata = {
title:...