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

fix(nextjs): Await Next.js server in patched getServerRequestHandler #6072

Merged
merged 1 commit into from Oct 31, 2022

Conversation

lforst
Copy link
Member

@lforst lforst commented Oct 27, 2022

Fixes #6059

Attempts to fix a bug where we try to grab the prototype of the Next.js server even though it hasn't been created yet. I couldn't repro this locally - I think this might be due to a race condition.

I believe (emphasis on "believe") it is safe to call getServer inside of the getServerRequestHandler function because Next.js itself calls it in there: https://github.com/vercel/next.js/blob/0beed3563cdab846fd6b683f1ed5586de3e7d96d/packages/next/server/next.ts#L175

@lforst lforst changed the title fix(nextjs): Await Next.js server when patching `getServerRequestHand… fix(nextjs): Await Next.js server when patching getServerRequestHandler Oct 27, 2022
@lforst lforst changed the title fix(nextjs): Await Next.js server when patching getServerRequestHandler fix(nextjs): Await Next.js server in patched getServerRequestHandler Oct 27, 2022
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.5 KB (-0.01% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 60.35 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.12 KB (-0.03% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 53.68 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 19.86 KB (-0.02% 🔽)
@sentry/browser - Webpack (minified) 65.09 KB (0%)
@sentry/react - Webpack (gzipped + minified) 19.89 KB (-0.01% 🔽)
@sentry/nextjs Client - Webpack (gzipped + minified) 45.75 KB (-0.01% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.22 KB (-0.02% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.6 KB (-0.01% 🔽)

@lforst lforst marked this pull request as ready for review October 28, 2022 07:22
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

poked through the source code and this look safe 🤞

@lforst lforst merged commit 0ccb760 into master Oct 31, 2022
@lforst lforst deleted the lforst-await-nextjs-server branch October 31, 2022 14:23
@kachkaev
Copy link

Glad to see this fix merged! What’s your typical ETA to release? Just curious, working on blockprotocol/blockprotocol#692 🙃

@lforst
Copy link
Member Author

lforst commented Oct 31, 2022

Soon TM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nextjs 13 / Cypress: TypeError: Cannot convert undefined or null to object
3 participants