Questions tagged [next-link]
67 questions
11
votes
3 answers
UnhandledSchemeError: What is this node:buffer error and how do I solve it?
Pasted below is a node:buffer error that I've received when using a link to a local route in nextjs. Anyone know how to solve this?
I see: https://github.com/vercel/next.js/discussions/33982
thanks!
node:buffer
Module build failed:…

421
- 203
- 1
- 5
- 13
8
votes
4 answers
Why Nextjs Link scroll to top not working, when I change route
I am using next/link, but when I change the route, scroll to top not working.
Go
What I should do?
I try too much methods and I did not have result.

programm011
- 141
- 1
- 1
- 6
6
votes
2 answers
How to trigger hard refresh when redirecting to a different page in Next.js?
I have a to a certain page on my Next.js website. Upon clicking it, I want the webpage to hard reload after it redirects to the destination page (whether it reloads before or after the redirect is not important). I have tried using…

Niranjan Rajesh
- 85
- 1
- 1
- 4
5
votes
3 answers
How to fix unexpected behavior of Next/Link when it is a child of a button?
I am experiencing some issues with next/link when I use it in my app.
I have a reusable component that renders a button. This component is used twice on the page with different urls each time.
When the page is in desktop view, the button works…

Leo
- 481
- 2
- 9
- 20
4
votes
0 answers
Unhandled Runtime Error: Failed to load script: /_next/static/chunks/pages/api/twitter/generate-auth-link.js
I have a Link tag that looks like Login with Twitter.
I have already created pages/api/twitter/generate-auth-link.ts that looks like:
import { NextApiResponse } from 'next'
import TwitterApi from…

deadcoder0904
- 7,232
- 12
- 66
- 163
4
votes
1 answer
Should you use next/link (prefetched client side transitions) for pages with any dynamic content?
From: next/link
You can see that the component from next/link enables client-side transitions and link prefetching, which are great features, but maybe not for all cases.
Please see the caveat I've run into. Let's say I have the following…

cbdeveloper
- 27,898
- 37
- 155
- 336
3
votes
1 answer
why nextjs link is prefetching on each hover?, how to disable it?
so it seems I'm using the latest version of Nextjs which is 13.2.4v, i also not using the app or src directory.
the problem is when i hover on the Link Next component, it will send a request to the server, we know that will reduce the performance.
i…

kxown
- 95
- 1
- 6
2
votes
2 answers
The Smooth Scrolling is not working next/link
I am using next/Link but smooth scrolling is not working but when i use anchor tag it is working properly while using anchor tag page is reloading but next/link doesnt load page whenever path changes
Css
html {
scroll-behavior:…

Azeem Khan
- 95
- 5
2
votes
1 answer
Link anchor (#) in NextJS not scrolling to id, but when manually typed in the url it works NEXTJS 13
I'm trying to make a single paged site where the navigations will scroll to a certain div or portion of the page. I searched the implementations but somehow it does not work when I click the link. The link is working because it changes color and…

u_ser
- 43
- 4
2
votes
0 answers
next/link is changing href attribute from relative to absolute
2
votes
2 answers
How to conditionally render a button / Link Next.js Component with TypeScript
I ran into a very annoying problem is that I get a bunch of typescript errors, while trying to conditionally render the Next.js Link component or a button element.
So if the href prop is passed, I want to render Next.js built-in Link component, else…

Denis
- 23
- 1
- 4
2
votes
2 answers
Next js dynamic routing for translation
I'm trying to set dynamic routes for translation for specific pages in next js using i18next. The following code works well, but this is routing to all pages and generating errors while next build.
const router = useRouter();
const path =…

Mohammed Rehan
- 63
- 2
- 8
2
votes
1 answer
how to make clickable part of in next js?
I made clickable the specific part of with the next link and it works fine, but in console, it shows a warning
Warning: validateDOMNesting(...): cannot appear as a child of .
here is my code:
…
Myrat
- 347
- 2
- 4
- 16
2
votes
1 answer
NextLink Dynamic Route Not Working When In Dynamic Route
I have an dynamic route which is sitename.com/[username]
When I navigate from sitename.com/account to sitename.com/[username] (for example when I am in /account page, I click an username which is abdulkadirkg) it is working. But if I am in…
Abdulkadir KG
- 83
- 1
- 8
2
votes
1 answer
NextJS add styling to a dynamic active link
I have more than 5 categories that have different products in them. So in my pages folder, I have a file named [...slug].js. All this URL's have different names;
For Ex these are my URL;
/phones
/laptops
/tv
..and I want to add class names to…
Rinael
- 133
- 3
- 12
I made clickable the specific part of with the next link and it works fine, but in console, it shows a warning
Warning: validateDOMNesting(...): cannot appear as a child of .
here is my code:
…

Myrat
- 347
- 2
- 4
- 16
2
votes
1 answer
NextLink Dynamic Route Not Working When In Dynamic Route
I have an dynamic route which is sitename.com/[username]
When I navigate from sitename.com/account to sitename.com/[username] (for example when I am in /account page, I click an username which is abdulkadirkg) it is working. But if I am in…

Abdulkadir KG
- 83
- 1
- 8
2
votes
1 answer
NextJS add styling to a dynamic active link
I have more than 5 categories that have different products in them. So in my pages folder, I have a file named [...slug].js. All this URL's have different names;
For Ex these are my URL;
/phones
/laptops
/tv
..and I want to add class names to…

Rinael
- 133
- 3
- 12