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

Hybrid AMP pages and getStaticProps doesn't export .amp pages #11332

Closed
MickCoelho opened this issue Mar 24, 2020 · 1 comment · Fixed by #11331
Closed

Hybrid AMP pages and getStaticProps doesn't export .amp pages #11332

MickCoelho opened this issue Mar 24, 2020 · 1 comment · Fixed by #11331

Comments

@MickCoelho
Copy link

MickCoelho commented Mar 24, 2020

Bug report

Describe the bug

next build won't export .amp pages when the hybrid pages use getStaticProps

To Reproduce

1 - Create an hybrid AMP page
2 - Run next build
3 - Both page.html and page.amp.html are export in the out folder
4 - Add getStaticProps onto the page
5 - Run next build
6 - Only the page.html is being exported

Code Sample

import { useAmp } from 'next/amp'
export const config = { amp: 'hybrid' };
export async function getStaticProps() {
  return {
    props: {},
  }
}

export default function Index() {
  const isAmp = useAmp()
  return (
    <div>
      <p>Hello Next.js</p>
    </div>
  );
}

Expected behavior

No matter if getStaticProps is being used, an hybrid AMP page should end up exporting both page.html and page.amp.html.

System information

  • Version of Next.js: 9.3.2-canary.4
@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.

2 participants