454 questions with no upvoted or accepted answers
8
votes
0
answers
938
views
Avoid render-blocking CSS files in App Router (Next.js)
When running a Next.js (v14) site through Google Lighthouse CSS files served on my App Router always get flagged as a render-blocking resource.
When using the Page Router this isn't an issue, as Next....
7
votes
0
answers
2k
views
Next action is not assignable to type string
I'm working on a project using Next.js 14 and I've encountered an issue with server actions.
I have a submit function:
async function submit(formData: FormData) {
// function implementation
}
I'm ...
5
votes
0
answers
579
views
AWS Amplify Auth Giving UserUnAuthenticatedException When used with ssr:true
As per the AWS Amplify Official Document, since I want to use auth with SSR, I have configured Amplify using following code
import { Amplify } from 'aws-amplify';
import config from '../...
4
votes
0
answers
572
views
How to handle multipart formData in next.js 14 server actions
Here is my Next.js page.jsx file code where i handle a form file using browser new FormData() web api and this uploadImageConverter function is a server actions function.
"use client"
...
4
votes
0
answers
1k
views
Next.js 14 - Cannot import 'next/font/local' (module-not-found) but 'next/font/google' works
I am using Next.js 14.1.0 with the app/ directory and I am trying to import and use custom local fonts but I cannot import next/font/local despite the fact that I can import next/font/google normally ...
4
votes
0
answers
910
views
use generateStaticParams() in layout.tsx NextJS 14 app directory to get dynamic rotes prerendered (PPR)
The idea is to make /[locale]/en and /[locale]/ka directories generated statically with PPR. Interesting is that without the locale, as a parameter, the / directory has PPR sign after it is build (npm ...
4
votes
0
answers
260
views
Next JS Error occurred prerendering page 404 in Next: 14.0.4 with next js pages structure (old page structure)
I hope this message finds you well. I'm currently facing an issue with prerendering in Next.js version 14. The error specifically occurs when attempting to prerender the "/404" page. The ...
4
votes
1
answer
3k
views
How to set up Azure MSAL for my Next Js App using App Router
I am working on a react app which uses App Router and runs on Next.js v 14.1.0 . Next.js App Router using app folder and containes layout.tsx as wrapper for react app.
I wanted to do Single Sign on ...
3
votes
1
answer
186
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 ...
3
votes
2
answers
820
views
Force pages to re-render (Next.js App-Dir)
For this question I have created the following demo Next.js application using the App directory:
It has a standard RootLayout in app/layout.tsx.
It has a nested Layout in a route group app/(app)/...
3
votes
0
answers
635
views
How to Modify Middleware to Handle Two Route Groups in Next.js
I'm working on a Next.js project where I have two route groups, (auth) which contains my auth pages and (root) which contains the dashbaord and other pages and a homepage "/. I have a middleware ...
3
votes
1
answer
594
views
Directly invoke a Server Action from a Server Component in NextJS
I need to set a cookie in a Server Component route. This is not directly possible, but it can be done from Server Actions and Routes. I can't figure out how to invoke a Server Action from a Server ...
3
votes
0
answers
893
views
How can I handle “Uncaught (in promise) Error: ClerkJS: Token refresh failed” error when offline?
I’m currently working on a NextJS app (app router) and went with Clerk for authentication using their @clerk/nextjs (4.29.7) package.
Everything works great until the internet connection is ...
3
votes
0
answers
1k
views
Socket.io implementation in Next.js 14.1.0 app directory
I want to implement a video conference app where I need to implement socket connection for specific rooms. Since Next.js is a serverless framework, I had to create a default GET method and initialize ...
3
votes
0
answers
300
views
Any better way to internationalize Metadata with next-intl in a Next.js 13+ page?
I would like to internationalize text on every page in my app, as well as the title of the pages.
Starting with the text, as per the next-intl documentation page on internationalizing components, it ...