Skip to content

fix: use static 404 for non-prerendered dynamic routes without fallback #1795

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

Merged
merged 9 commits into from
Dec 9, 2022

Conversation

orinokai
Copy link
Contributor

@orinokai orinokai commented Nov 22, 2022

Summary

Earlier this year, an issue was raised about fallback: false being ignored on dynamic routes.

It was fixed with a partial solution that correctly rendered 404 pages on non-prerendered pages, but it still routed them via the handler function (creating an unnecessary function invocation).

This PR resolves that last issue, routing non-prerendered dynamic routes to the static 404 page (default or custom) when fallback === false and when the 404 page itself is not an ISR page.

Test plan

Tests included in dynamic-routes.spec.

This is a big-ish change to dynamic routing and probably worth rolling-out gradually behind a flag.

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

hedgehog birthday party

@orinokai orinokai requested a review from a team November 22, 2022 09:47
@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit b152df2
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/6391dc2e816f3a0009dbb85a
😎 Deploy Preview https://deploy-preview-1795--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit b152df2
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/6391dc2e3295960009a26ef4
😎 Deploy Preview https://deploy-preview-1795--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit b152df2
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/6391dc2e427fa00008bdce8a
😎 Deploy Preview https://deploy-preview-1795--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit b152df2
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/6391dc2e77b91f0008cd3a74
😎 Deploy Preview https://deploy-preview-1795--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit b152df2
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/6391dc2e0700180008b53e52
😎 Deploy Preview https://deploy-preview-1795--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Nov 22, 2022
@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit 1c707a0
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/637c9ac3f6e987000859508a
😎 Deploy Preview https://deploy-preview-1795--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo failed.

Name Link
🔨 Latest commit 1c707a0
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/637c9ac32b2e990007d08b28

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit b152df2
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/6391dc2ebf27de000d4c719f
😎 Deploy Preview https://deploy-preview-1795--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit b152df2
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/6391dc2e55a31300082e363c
😎 Deploy Preview https://deploy-preview-1795--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 1c707a0
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/637c9ac3d54b5a000976a61f
😎 Deploy Preview https://deploy-preview-1795--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit 1c707a0
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/637c9ac30232670009178e51
😎 Deploy Preview https://deploy-preview-1795--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit b152df2
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/6391dc2ecaa99b00081dc59d
😎 Deploy Preview https://deploy-preview-1795--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit b152df2
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/6391dc2e51ed33000894dd37
😎 Deploy Preview https://deploy-preview-1795--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTP 200 🚀

Copy link

@ericapisani ericapisani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small request, but otherwise these code changes are looking great!

@kodiakhq kodiakhq bot merged commit 2aa02db into main Dec 9, 2022
@kodiakhq kodiakhq bot deleted the rs/isr-fallback-false branch December 9, 2022 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants