✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Stuck on source context error in Sanity studio login screen, issue resolved by identifying the useDataset function causing the crash.

10 replies
Last updated: Mar 1, 2024
Hi, we are stuck on this source context error on the login screen of Sanity studio. This trace is from localhost when running dev, but we get the same when building for production, but obfuscated. So maybe someone has an idea from this trace?
Feb 23, 2024, 10:30 AM
What version of the Studio are you running?
Feb 23, 2024, 6:41 PM
Sanity 3.30.0
Feb 26, 2024, 10:02 AM
We are still stuck on this one. Looking for any guidance on how to move forward.
Feb 28, 2024, 6:42 AM
Which browser is this happening in? Are you using a VPN or firewall?
Feb 28, 2024, 4:48 PM
All browsers, chrome, edge, safari mac and iPhone. No VPN or changes to firewalls.
Feb 28, 2024, 4:49 PM
The users that have logged out are unable to load the site at all. So I have informed everyone else NOT to log out. Running an old v2 on localhost allows my self to log in. And then I can use the current version again. So, it's some logged out part of the site that crashes.
Feb 28, 2024, 4:57 PM
I tried setting up a new blank studio with the same id. That works, at least on my machine and with no schema or settings. So now starts the huge project of adding some 🧀 🍕 🥧 one by one to see where it breaks.
Still: I would think the fact that it works once I get past the login should be a clue that one of you
🧙‍♂️ gets a💡by..

🙏
Feb 29, 2024, 1:22 PM
Turned out to be that useDataset from sanity, which was used to choose the logo, was not happy being called on the login screen. 🙇‍♂️ Doh!
Mar 1, 2024, 6:30 PM
Thanks for updating us!
Mar 1, 2024, 6:36 PM
Are there any up to date tutorials on how to detect dataset and environment that does not have these types of pitfalls? Especially current dataset and the stage/prod environment.
Mar 1, 2024, 6:39 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?