Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Generating static pages even with no paths and fallback:false #15383

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

Closed
arunoda opened this issue Jul 21, 2020 · 1 comment · Fixed by #16401
Closed

Generating static pages even with no paths and fallback:false #15383

arunoda opened this issue Jul 21, 2020 · 1 comment · Fixed by #16401
Assignees
Milestone

Comments

@arunoda
Copy link
Contributor

arunoda commented Jul 21, 2020

Bug report

Describe the bug

I have a simple blog app:

  • Shows a list of posts in the homepage
  • Then when clicked it shows the blog post

I have configured the getStaticPaths of the post page with following:

export async function getStaticPaths () {
  return {
    paths: [],
    fallback: false
  }
}

Due to above, I expect to get 404 for blog posts. But they do give me correct static pages.

To Reproduce

Expected behavior

The blog post should give us 404.

Demo Video

https://www.youtube.com/watch?v=XqSqTwBa-N0

System information

  • OS: macOS
  • Browser: Chrome
  • Version of Next.js: canary (same behavior even with latest)
  • Version of Node.js: [e.g. 12.x.x]
@Timer Timer modified the milestones: iteration 6, iteration 5 Jul 22, 2020
@Timer Timer modified the milestones: iteration 6, iteration 7 Aug 6, 2020
@Timer Timer added the point: 2 label Aug 6, 2020
@Timer Timer self-assigned this Aug 18, 2020
@kodiakhq kodiakhq bot closed this as completed in #16401 Aug 20, 2020
kodiakhq bot pushed a commit that referenced this issue Aug 20, 2020
We were accidentally allowing data requests to be rendered unconditionally. Instead, we should also check them against the staticPaths result and 404 when appropriate.

---

Fixes #15383
@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 29, 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