Questions tagged [next.js14]
Next.js 14 is a version of the Next.js JavaScript web development framework released on October 26th, 2023 and includes improved memory management and performance, Turbopack, a new Rust compiler, support for partial rendering, and stable server actions. Use this tag only for questions specific to Next.js 14 and its features. For generic Next.js programming questions, the [next.js] tag should be used.
next.js14
502
questions
0
votes
0
answers
17
views
Attempt to delete a document on Mongodb Atlas times out and returns an error
I am using Postman to test deleting a document on Mongodb atlas in a NextJs 14.2.4 application using the api router. The problem is that my delete methods time out and the document is not deleted. ...
0
votes
0
answers
30
views
"You're importing a component that needs next/headers. That only works in a Server Component which is not supported in the pages/ directory"-error
I'm following this tutorial to create a preview mode in Sanity. But when importing:
import { draftMode } from 'next/headers';
into client.ts I'm getting this error:
Error: × You're importing a ...
0
votes
0
answers
10
views
What information is contained in the trace file in the .next directory of a Next.js project?
I am working on a Next.js project, and I have encountered an issue where the build process is extremely slow, taking almost an hour to complete. While investigating the potential causes, I came across ...
0
votes
0
answers
24
views
Why am I getting a 404 Page Not Found error in my Next.js 14 application?
I am encountering a 404 error, along with the correct content, in my Next.js 14 application. I have checked the folder structure, but I still don't understand what the problem is. If I route to other ...
-4
votes
0
answers
23
views
Next.js 14 Cache CANNOT BE DISABLED ... NO MATTER WHAT ... IS THIS A BUG?
next.js caching cannot be disabled ... I've used:
export const dynamic = 'force-dynamic' ... no luck
revalidate: 0 ... no luck
cache: 'no-store' ... no luck
all combined ... no luck
and then this ...
0
votes
0
answers
7
views
Next.js App router behavior in building a page when generateStaticParams is provided and layout is dynamic
this is my folder structure
I am using next.js 14
in root layout i use user data to display user avatar which cause all pages become dynamic
in page.js inside /cabins/[cabinId] i have exported ...
0
votes
1
answer
66
views
npm ERR! npm ERR! sh: line 1: node-waf: command not found [closed]
I got an error during deployment, as follows:
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN ERESOLVE overriding peer dependency
npm ERR! npm WARN ERESOLVE ...
2
votes
0
answers
103
views
Getting error: Failed to parse body as FormData in Next.js 14 app router
I have a Next 14 app router project, so the problem is in the dashboard page and in a more clear way in the add and update form, I'm using Formik to handle the forms and then I send the data as ...
0
votes
0
answers
14
views
"Chrome is undefined" error when using chrome extension API in next.js [duplicate]
I am trying to send a message through chrome API from my next.js app to the extension app. I'm using useEffect to call this function in one of my .tsx context files like this:
useEffect(() => {
...
0
votes
0
answers
21
views
Next js 14 app router always Hard refresh when behind cloudfront
I am working with nextJs 14 app router and it's behind CloudFront
My application works very weirdly it is always hard refresh irrespective of whether I use the Link component of the nextJs.
I have ...
0
votes
0
answers
21
views
Deployment of Static Site Generation (SSG) in next.js 14 version
I need to build a Next.js app where I have Static Site Generation (SSG) pages. This means that I want to generate static pages at build time. I need to get information for my static pages from a ...
-7
votes
0
answers
131
views
+500
How to properly handle internal/external API errors in service-, data- & app layers in Next.js? [closed]
I'm building a Next application with the following layers:
lib/service (async server-only functions doing a fetch from an external api and returning the data)
data (async server-only functions that ...
0
votes
0
answers
20
views
Syntactic problems with Redux middleware when try to add .concat(authMiddleware)
Here is authMiddleware:
"use client";
import { Middleware } from "@reduxjs/toolkit";
import { clearUserProfile } from "../reducers/userProfile";
import { clearIdToken } ...
0
votes
0
answers
16
views
Next.js 14 - require crypto error with mysql2 in turbo mode
For the past few days, I've been trying to get turbo mode working in Next.js 14 with MySQL2. Despite using every available resource to solve the issue, I'm still stuck with the error. My large project ...
0
votes
1
answer
26
views
How to pretend to render any Components of root Layout.js to an specific route in Next.js?
I'm working in Next.js, in my root Layout.js file I added some Components, and they are rendering in my all the routes as I expected.
But I have a route /mobile, where I want want these Components to ...