Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link tag from 'import Link from 'next/link'' not working for AMP only pages #26313

Closed
kannasuresh99 opened this issue Jun 18, 2021 · 0 comments
Closed
Labels
bug Issue was opened via the bug report template.

Comments

@kannasuresh99
Copy link

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

  1. npx create-next-app myapp
  2. Add export const config = { amp: true } in index.js
  3. Add import Link from 'next/link'
  4. create a new file about.js in the pages folder
  5. Simply add a <h1> tag which displays click here to go to about page
  6. Now Place the <h1> tag between the <Link href='/about'> tag
  7. Run npm run dev or next start
@kannasuresh99 kannasuresh99 added the bug Issue was opened via the bug report template. label Jun 18, 2021
@vercel vercel locked and limited conversation to collaborators Jun 18, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

2 participants