fix: Properly configure SDK to be distributed as ESM#2171
fix: Properly configure SDK to be distributed as ESM#2171frederikprijck merged 2 commits intomainfrom
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:
requestobject togetSession()when used in middleware.As this only breaks in local development, when using turbopack, and only when not passing down
requesttogetSessionin 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