Repository navigation
fix: apply non-browser defaults when cookies only sets encode - #294
Merged
Merged
Conversation
mandarini
approved these changes
Sep 8, 2026
mandarini
left a comment
Contributor
There was a problem hiding this comment.
Thanks, that's a nice clean fix.
mandarini
pushed a commit
that referenced
this pull request
Sep 8, 2026
🤖 I have created a release *beep* *boop* --- ## [0.12.7](v0.12.6...v0.12.7) (2026-09-08) ### Bug Fixes * apply non-browser defaults when cookies only sets encode ([#294](#294)) ([9d6e2a5](9d6e2a5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #293.
createBrowserClientwithcookies: { encode: "tokens-only" }and no accessors throws outside a browser runtime (for example Next.js pre-rendering), while omittingcookiesentirely works there. #213 added the encode-only fallback but only mirrored thedocument.cookiebranch, so the non-browser branch was skipped:cookies: { encode: "tokens-only" }->createBrowserClient requires configuring getAll and setAll cookie methodsgetAll/setAll->ReferenceError: window is not defined(fromuserStorage: window.localStorage)A cookies object without
get/getAllis now treated the same as omittingcookies, so every runtime goes through the existing defaults (document.cookiein browsers, the emptygetAllplus lazy-throwingsetAllelsewhere), and the encode-only branch from #213 is no longer needed.userStoragefalls back tomemoryLocalStorageAdapter()outside a browser, matchingcreateServerClient.Tests: two cases in
createBrowserClient.spec.tsrun without awindowstub; both fail on main and pass here. Full suite 120/120,prettier --check,eslintand both tsc builds clean.