Skip to content

fix: checks when Next.js' implementation of ResponseCookies._headers is undefined now #2119

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

Conversation

nickytonline
Copy link

@nickytonline nickytonline commented May 16, 2023

Description

In some instances response.cookies._headers was undefined even though the types say they're not supposed to be causing the check introduced in #2027 to crash. Now we check if response.cookies._headers is defined before doing any operations on it.

Documentation

Tests

You can test this change yourself like so:

  1. There are already E2E tests in place from fix: support setting cookies from MiddlewareResponse #2027

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

Non-standard implementation of ResponseCookies, https://github.com/vercel/next.js/blob/de08f8b3d31ef45131dad97a7d0e95fa01001167/packages/next/src/compiled/@edge-runtime/cookies/index.js#L158

Closes https://github.com/netlify/pod-ecosystem-frameworks/issues/475

@netlify
Copy link

netlify bot commented May 16, 2023

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

Name Link
🔨 Latest commit c017a26
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/6465071ebae763000877533a
😎 Deploy Preview https://deploy-preview-2119--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 May 16, 2023

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

Name Link
🔨 Latest commit c017a26
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/6465071ee42bc80009f83d27
😎 Deploy Preview https://deploy-preview-2119--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.

@github-actions github-actions bot added the type: bug code to address defects in shipped code label May 16, 2023
@netlify
Copy link

netlify bot commented May 16, 2023

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

Name Link
🔨 Latest commit c017a26
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/6465071ed77d67000814a4ed
😎 Deploy Preview https://deploy-preview-2119--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 May 16, 2023

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

Name Link
🔨 Latest commit c017a26
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/6465071e44799100087fcbe8
😎 Deploy Preview https://deploy-preview-2119--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 May 16, 2023

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

Name Link
🔨 Latest commit c017a26
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/6465071e13e3850007d509bf
😎 Deploy Preview https://deploy-preview-2119--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.

@netlify
Copy link

netlify bot commented May 16, 2023

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

Name Link
🔨 Latest commit c017a26
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/6465071e1010a40008de6e5a
😎 Deploy Preview https://deploy-preview-2119--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 May 16, 2023

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

Name Link
🔨 Latest commit c017a26
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/6465071e4991870008ba9921
😎 Deploy Preview https://deploy-preview-2119--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 May 16, 2023

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit c017a26
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/6465071e1d9b680007560076
😎 Deploy Preview https://deploy-preview-2119--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 May 16, 2023

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit c017a26
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/6465071ecc88d7000832bf42
😎 Deploy Preview https://deploy-preview-2119--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.

@nickytonline nickytonline marked this pull request as ready for review May 16, 2023 21:41
@nickytonline nickytonline requested a review from a team as a code owner May 16, 2023 21:41
@nickytonline nickytonline self-assigned this May 16, 2023
@kodiakhq kodiakhq bot merged commit f051e22 into main May 17, 2023
@kodiakhq kodiakhq bot deleted the nickytonline/next-response-cookie-headers-missing-sometimes branch May 17, 2023 17:51
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.

2 participants