All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
0 answers
2k views

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 <Link href='/api/twitter/generate-auth-link'>Login with Twitter</Link>. I have already created pages/api/twitter/generate-auth-link.ts that looks like: ...
deadcoder0904's user avatar
2 votes
2 answers
5k views

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 ...
Denis's user avatar
  • 23
2 votes
2 answers
1k views

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. ...
Mohammed Rehan's user avatar
2 votes
1 answer
275 views

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 ...
Azeem Khan's user avatar
1 vote
2 answers
875 views

How to send data through Link in Next/JS?

My Next version is 13.1.5. I am trying to send contact.name through the Link in my component. Whats the best way to do this? The first code of the Link is just my original code. <Link ...
Karnveer Grewal's user avatar
1 vote
2 answers
5k views

NextJS Link href default value

I need a default href value for Next/Link, as we do in plain html like below <a href='#' ></a> I tried this to Link but it reloads the page, if I keep it empty it produces some error ...
MVP's user avatar
  • 93
1 vote
4 answers
2k views

NextJs <Link> doesn't rerun scripts

When I use the <Link> tag in NextJs to navigate between pages it doesn't rerun my scripts after changing pages. It only runs the scripts after the first page load or when I press reload. When ...
Dan P's user avatar
  • 53
1 vote
2 answers
6k views

How to send a unique id to the next page while navigating using Link in NextJS

I am trying to send an id to the next page when the user navigates. I have a homepage where I am fetching an Array of data and using .map to display it in a kind of card-based UI. Now, when the user ...
anshul's user avatar
  • 721
1 vote
0 answers
413 views

Next/Link keeps reload in components

It is said that in next js we don't need to install react-router-dom because the path of our pages depend on the pages folder. Well, it actually works when I create button to move to another pages. ...
Farhan Ersavan's user avatar
1 vote
1 answer
425 views

How to fix net::ERR_ABORTED 404 (Not Found) when callink api route using next/link in NextJS

I have created an api route to download a CSV file and I am getting this error when using Next Link. I cannot just switch to because then my application will not build, so my hands are tied. The ...
seven's user avatar
  • 1,370
1 vote
0 answers
992 views

how to keep url query string values even on page refresh

I am using useRouter and Link, while navigating through my webapp. I attach query string to the links so that i can use the passed data of the query, in the page i am redirecting the user to. which ...
jeho Ntanda's user avatar
0 votes
1 answer
2k views

How do you fix Next.js 14 next/link routing 404 error page issue

I just did a fresh install of Next.js using npx create-next-app@latest on Windows (using an elevated shell). My /src/app/components/Header.tsx file has this code: import React from 'react'; import ...
stonelar's user avatar
0 votes
1 answer
53 views

NextJS Dynamic Link for Page & Subpage

Using NextJS I Have Dynamic Pages and Dynamic SubPages. Here is Folders/Files : pages ├── [Formation] ├── index.js │ ├── [SubPage].js In index.js (Formation Page), I Create Links : <Link href={`[...
Lucas's user avatar
  • 95
0 votes
1 answer
285 views

NextJs: Next Link router query returns undefined after submitting form on page

I am using nextjs, I have a page where it lists out all clients, I can then click each client name that links (using next/link) to a page specifically for that client. It loads correctly using ...
tester0001's user avatar
0 votes
0 answers
36 views

Use script with next/link routing

In my nextjs project I have the following case: Let's say I have two templates, myTemplate1 & myTemplate2. In myTemplate1 after I render my components I have script. E.g: return (... {...
Teo 's user avatar
  • 1
0 votes
1 answer
226 views

How to do components wise routing in NEXT.js? [closed]

I have a sidebar which contains some tabs like profile, settings, insights now when click on one of the tab it should show particular content where routes should change but page should not be refresh. ...
Dinesh Basnet's user avatar
-1 votes
1 answer
2k views

Next js with dynamic routing ([[…slug.js]]) to handle all URLs show 404 for links to home page - but only when deployed

I want a single dynamic route to handle all requests in this application, so I have written a file named [[...slug]].js to do so. I use getServerSideProps() for data loading, so it is server-side ...
hallvors's user avatar
  • 6,127
-1 votes
1 answer
892 views

Next.js: how to create entry browser history [duplicate]

I have been trying to create an entry in the browser history every time I navigate to a new page in Next.js with the Link property provided by them, but I am not able to push an entry to the browser ...
Micael Coutinho's user avatar