Questions tagged [app-router]
The app-router tag has no usage guidance.
app-router
424
questions
0
votes
0
answers
11
views
How to statically generate a page in Next.js app router
I am using Next.js App Router.
I have a page /blogs that should display the titles of all the blogs. I am using markdown for the blogs and they are stored inside blog-content folder of src folder. And ...
0
votes
0
answers
15
views
NextJS App router reusable custom hook for data fetching
I'm currently trying to migrate a project from NextJS pages router to the app router.
In my old project, I had the following structure:
/src
/components
/hooks
customHook.tsx
/services
...
0
votes
0
answers
24
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
15
views
NextJS 14 App Router, cache dynamic ...slug pages with revalidate, but cache miss
I have a setup using NextJS 14 App Router with Storyblok CMS to fetch content. Therefore I do not have any particular folder structure setup, but instead use the following setup:
- app
- layout.tsx (...
0
votes
0
answers
6
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 ...
2
votes
0
answers
97
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
20
views
How to refresh routes in next js 14 app router?
I am trying to get my nextjs app to refresh routes after a form submits, so that i can update data on the page, without refreshing the browser.
I have these server actions:
'use server';
import { ...
0
votes
0
answers
23
views
redux-persist failed to create sync storage. falling back to noop storage. in NextJS/App Router [duplicate]
I'm trying to set up a simlpe Redux store in my NextJS 14/Typescript web app with persistent data. Here's what I have so far from following official doc, and a few blogs here and there.
provider.tsx
&...
0
votes
0
answers
25
views
Unable to exporting metadata object from Next.js layout.js file
I am trying to add the metadata object in my layout.js file. Hovever, I get the error "You are attempting to export "metadata" from a component marked with "use client", which ...
0
votes
0
answers
14
views
How can i integrate this rb2b analytics script in nextjs 14
This page: https://support.rb2b.com/en/articles/9116902-how-to-add-rb2b-s-script-to-next-js
show's how to integrate their script in nextjs pages.
I'm wondering what would be the best way to integrate ...
0
votes
0
answers
8
views
How to Handle Internationalisation and store region while statically generating all the pages in nextjs 14
Am building out a small e-commerce website that has like 4-10 products. which also has multiple language support, and multiple regional support.
├── api
│ ├── revalidate
│ │ └── route.ts
│ └── ...
0
votes
0
answers
88
views
nextJS not building, throwing 'TypeError: Invalid URL'
No matter what I try my nextjs 14 app keeps failing on build (on this for days now). Unfortunately the error is thrown in webpack'd minimized files, but monkey patching and commenting out has me ...
0
votes
0
answers
20
views
how to use next-i18next in nextjs V14 in App Router convetion?
I read the document and configured the project according to it, but it didn't work. The relevant code is below:
// next.config.js
const { i18n } = require('./next-i18next.config')
module.exports = {
...
0
votes
0
answers
15
views
urql TypeError: t.executeQuery is not a function
Assumptions
Node.js 20.14.0
Next.js 14.2.3
urql 4.1.0
@urql/core 5.0.4
@urql/next 1.1.1
Main topic
When I use Urql in the Client Component of Next.js, I get this error message.
TypeError: t....
0
votes
0
answers
37
views
mantine ui connect to the next js project, it get 404 error line
`> next dev
▲ Next.js 14.2.4
Local: http://localhost:3000
✓ Starting...
✓ Ready in 3.6s
○ Compiling / ...
✓ Compiled / in 5.8s (717 modules)
GET / 200 in 6145ms
○ Compiling /_not-found ...
...