fix(clerk-js): Use a cookie instead of localStorage for active org
Description
Fixes an issue where browsers with localStorage disabled would cause an error to be thrown.
Checklist
- [ ]
npm testruns as expected. - [ ]
npm run buildruns as expected. - [ ] (If applicable) JSDoc comments have been added or updated for any package exports
- [ ] (If applicable) Documentation has been updated
Type of change
- [ ] 🐛 Bug fix
- [ ] 🌟 New feature
- [ ] 🔨 Breaking change
- [ ] 📖 Refactoring / dependency upgrade / documentation
- [ ] other:
🦋 Changeset detected
Latest commit: 435081d95f30cd980ca650c0fef687d6e3afad90
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 3 packages
| Name | Type |
|---|---|
| @clerk/clerk-js | Patch |
| @clerk/chrome-extension | Patch |
| @clerk/clerk-expo | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
!snapshot
Hey @BRKalow - the snapshot version command generated the following package versions:
| Package | Version |
|---|---|
| @clerk/astro | 1.4.1-snapshot.vff7a729 |
| @clerk/backend | 1.15.1-snapshot.vff7a729 |
| @clerk/chrome-extension | 1.3.22-snapshot.vff7a729 |
| @clerk/clerk-js | 5.29.0-snapshot.vff7a729 |
| @clerk/elements | 0.17.1-snapshot.vff7a729 |
| @clerk/clerk-expo | 2.2.28-snapshot.vff7a729 |
| @clerk/express | 1.3.3-snapshot.vff7a729 |
| @clerk/fastify | 2.0.5-snapshot.vff7a729 |
| @clerk/localizations | 3.4.0-snapshot.vff7a729 |
| @clerk/nextjs | 6.0.1-snapshot.vff7a729 |
| @clerk/clerk-react | 5.13.1-snapshot.vff7a729 |
| @clerk/remix | 4.2.41-snapshot.vff7a729 |
| @clerk/clerk-sdk-node | 5.0.54-snapshot.vff7a729 |
| @clerk/shared | 2.10.1-snapshot.vff7a729 |
| @clerk/tanstack-start | 0.4.17-snapshot.vff7a729 |
| @clerk/testing | 1.3.15-snapshot.vff7a729 |
| @clerk/themes | 2.1.39-snapshot.vff7a729 |
| @clerk/types | 4.28.0-snapshot.vff7a729 |
Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro
npm i @clerk/[email protected] --save-exact
@clerk/backend
npm i @clerk/[email protected] --save-exact
@clerk/chrome-extension
npm i @clerk/[email protected] --save-exact
@clerk/clerk-js
npm i @clerk/[email protected] --save-exact
@clerk/elements
npm i @clerk/[email protected] --save-exact
@clerk/clerk-expo
npm i @clerk/[email protected] --save-exact
@clerk/express
npm i @clerk/[email protected] --save-exact
@clerk/fastify
npm i @clerk/[email protected] --save-exact
@clerk/localizations
npm i @clerk/[email protected] --save-exact
@clerk/nextjs
npm i @clerk/[email protected] --save-exact
@clerk/clerk-react
npm i @clerk/[email protected] --save-exact
@clerk/remix
npm i @clerk/[email protected] --save-exact
@clerk/clerk-sdk-node
npm i @clerk/[email protected] --save-exact
@clerk/shared
npm i @clerk/[email protected] --save-exact
@clerk/tanstack-start
npm i @clerk/[email protected] --save-exact
@clerk/testing
npm i @clerk/[email protected] --save-exact
@clerk/themes
npm i @clerk/[email protected] --save-exact
@clerk/types
npm i @clerk/[email protected] --save-exact
Our mechanism for synching state across tabs also seems to be using local storage under the hood. Do we need to take a look at that as well ?
@panteliselef I don't think so, the other usages seem to be correctly wrapped in a try/catch, or at least they are failing gracefully. I confirmed with the customer that this fixed the issue they were seeing with localStorage disabled.
Hello 👋
We currently close PRs after 60 days of inactivity. It's been 50 days since the last update here. If we missed this PR, please reply here. Otherwise, we'll close this PR in 10 days.
Thanks for being a part of the Clerk community! 🙏
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| clerk-js-sandbox | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jan 27, 2025 6:54pm |