Error connecting to Sanity studio due to Chrome extension, resolved by disabling it.

20 replies
Last updated: Jan 8, 2023
ISSUE resolved: Extension "HTTPS Everywhere" inside Chrome caused problem. Extension is deprecated as same feature is now available in Chrome Security settings. See also article .
Hello Hello,
after using Sanity last time in September 22 a lot has changed and I'm looking forward to try the new version of Sanity.
Unfortunately I always seem to fail at the simplest step when running
npm run dev
to connect to the sanity studio on my localhost.I updated node, npm, made sure I'm logged into the correct account (locally and web) and that the CORS localhost has full allowance.

Error:
Unknown network error attempting to reach nhj2bb7j.api.sanity.io
The console tells me that the Header Access-Control-Allow-Header has a value not equal to the origin.

I appreciate any hints to solve this error
🙌
Jan 2, 2023, 5:22 PM
Hello
user H
👋Did you migrate your studio or did you just update the version?
Jan 2, 2023, 5:44 PM
Hey
user J
I started a new project with a new account and followed the sanity crash course on youtube and get this error.
Jan 2, 2023, 5:53 PM
I haven't migrate my September project yet and wanted to start from scratch first to see what changes have been made.
Jan 2, 2023, 5:55 PM
Which crash course?
Jan 2, 2023, 5:56 PM
link to Youtube
Jan 2, 2023, 5:58 PM
okay, but this still does not tell me anything about YOUR setup 😉 we need to look into that.
Jan 2, 2023, 6:00 PM
What do you mean by setup?
Jan 2, 2023, 6:06 PM
What would you like to know?
Jan 2, 2023, 6:06 PM
I followed this command according to the sanity docs
npx sanity@latest
As far as i understand the docs, this command bypasses the need to install the CLI globally.

I think I still have a global installation from earlier though.

I created a new account with
Sanity.io linked to google.I started a complete new project via VSCode Terminal.
I logged out of sanity before creating a new project.
my Node.js version via Homebrew is 19.3
npm is version 9.2
Sanity CLI states
@sanity/cli version 3.1.2
Jan 2, 2023, 6:14 PM
Yes, but this error as you can see does not occure because of the cli, but because CORS are not set correctly. Did you add https://localhost:3333 and https://localhost:3333 to the list?
Jan 2, 2023, 6:16 PM
And please do not send your responses to the channel 🙏You might have accidentally toggled this
🙂
Jan 2, 2023, 6:17 PM
I just added https to the CORS.No change of error though.
Jan 2, 2023, 6:21 PM
Sorry for the toggle 😅🙈
Jan 2, 2023, 6:21 PM
did you restart your dev server?
Jan 2, 2023, 6:26 PM
Ah and did you setup your client with tokens?
Jan 2, 2023, 6:27 PM
dev server restart -> yesclient with token -> No

Is a token now required?
Jan 2, 2023, 6:28 PM
Could you please show me, which url is open and what the “uncaught in promise” is saying?And btw. you need to make token-ed calls (and use env variables when you dont access your studio from a sanity deployed studio…

https://www.sanity.io/docs/environment-variables
Jan 2, 2023, 6:46 PM
is this helpful?
Jan 2, 2023, 7:03 PM
Hm, are you using a vpn by any chance?
Jan 2, 2023, 8:34 PM
Hello Saskia,Sorry for the late reply.
I'm not using a VPN. Also Double checked my routers settings.

However, I was able to resolve the error.
I tried different browsers and It could connect with Firefox and Safari.
Meaning Chrome was the culprit.
After searching and testing I found the extension "HTTPS Everywhere" to cause this problem.

Disabling it allows me to connect to the Sanity studio now.

Info: Extension deprecated for chrome. Same feature can be activated in Security Settings inside Chrome
Jan 8, 2023, 4:42 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?