Skip to content
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

Links from non-AMP pages to AMP pages causes broken pages #11521

Closed
kevva opened this issue Mar 31, 2020 · 7 comments · Fixed by #11527
Closed

Links from non-AMP pages to AMP pages causes broken pages #11521

kevva opened this issue Mar 31, 2020 · 7 comments · Fixed by #11527

Comments

@kevva
Copy link
Contributor

kevva commented Mar 31, 2020

Bug report

Describe the bug

When going from a regular page with amp: false to a page that has amp: true set, it won't render the AMP page correctly. E.g. all <amp-img> tags won't be visible and other AMP components won't work either.

Worth noting is that this doesn't happen during development.

To Reproduce

Clone https://github.com/kevva/next-link-amp and do the following:

  1. Run npm run build
  2. Run npm run start
  3. Go to the "Amp" link and the image that should be there won't be visible
  4. Go to "Amp (without Link)" and the image will show
@ijjk
Copy link
Member

ijjk commented Mar 31, 2020

Hi, it looks like the provided repo to reproduce is 404ing. I don't seem to be able to reproduce this locally on a minimal Next.js app using the latest version of Next.js v9.3.3

@ijjk ijjk added the please add a complete reproduction Please add a complete reproduction. label Mar 31, 2020
@kevva
Copy link
Contributor Author

kevva commented Mar 31, 2020

I'm sorry, I hadn't made it public.

@ijjk
Copy link
Member

ijjk commented Mar 31, 2020

Hi, thanks for providing the reproduction. It looks like this is due to not exporting the config in the same line e.g. export const config = {...}. I opened a PR to fix the mismatching behavior between production and development which should resolve this.

@kevva
Copy link
Contributor Author

kevva commented Mar 31, 2020

Oh, interesting, nice find.

@kevva
Copy link
Contributor Author

kevva commented Apr 22, 2020

@ijjk, I guess this might be out of scope since it's an experimental feature, but when setting modern: true it breaks in the same way as well. Probably because the pages are named [page].module.js instead of [page].js.

@ijjk
Copy link
Member

ijjk commented Apr 23, 2020

@kevva right, I opened a follow-up PR to handle the new modern experimental feature here

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants