-
Notifications
You must be signed in to change notification settings - Fork 422
fix: Properly configure SDK to be distributed as ESM #2171
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2171 +/- ##
=======================================
Coverage 82.66% 82.66%
=======================================
Files 21 21
Lines 2060 2060
Branches 362 362
=======================================
Hits 1703 1703
Misses 350 350
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thank you! |
Thanks @frederikprijck ! So, to clarify, after this fix is in, we will have to pass the request in to the getSession call in the middleware? |
@miriarte33 Even before this fix, you should. Not passing it in is not supported (we call it out here), but it will work in some cases. If you are not passing But again, not passing For clarity, I have reached out to the folks at vercel to talk about this, because I think this is an issue with turbopack. |
Makes perfect sense, thanks |
After merging #2028 and then reverting it again in #2046 , we are introducing the exact same changes again to fix our ESM bundling.
After merging #2028, it was called out to break a certain situation, so we immediately reverted again.
However, after some more investigation, we noticed that:
request
object togetSession()
when used in middleware.As this only breaks in local development, when using turbopack, and only when not passing down
request
togetSession
in middleware (which is clearly called out in our docs not to do), we have decided to release this as a fix for #1945 and not consider this a breaking change.Closes #1945