This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Link tag from 'import Link from 'next/link'' not working for AMP only pages #26313
Labels
bug
Issue was opened via the bug report template.
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
The text was updated successfully, but these errors were encountered: