Link tag from 'import Link from 'next/link'' not working for AMP only pages #26316
Unanswered
kannasuresh99
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What version of Next.js are you using?
11.0.0
What version of Node.js are you using?
14.16.0
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
next start
Describe the Bug
I'm using Nextjs to create an AMP-only website,
Here I'm using the Link tag from
import Link from 'next/link'
to do routing between the pages.But it is not working with the AMP-only page, when I removed
export const config = { amp: true }
from index.js, the Link started to work again. So in short, the Link tag works for non-amp pages and does not work for amp-pages.Any solutions to solve this problem are welcomed!
Expected Behavior
I want the
<Link href="#">
tag to work in the AMP-only page.To Reproduce
npx create-next-app myapp
export const config = { amp: true }
in index.jsimport Link from 'next/link'
about.js
in the pages folder<h1>
tag which displays click here to go to about page<h1>
tag between the<Link href='/about'>
tagnpm run dev
ornext start
Beta Was this translation helpful? Give feedback.
All reactions