sanity-io / next-sanity

Sanity.io toolkit for Next.js
https://www.sanity.io/
MIT License
756 stars 91 forks source link

Request Error users/me?tag=sanity.studio.users.get-current #1615

Open justincavery opened 3 months ago

justincavery commented 3 months ago

I've just gone through the steps of adding the studio to an existing project from here https://www.sanity.io/get-started?ref=navbar and doing npm create sanity@latest -- --project ew7rp6z0 --dataset production --provider google

When I load up the sanity studio at localhost:3001/studio I get the following error

Error: Request error while attempting to reach is https://ew7rp6z0.api.sanity.io/v2021-06-07/users/me?tag=sanity.studio.users.get-current
httpRequester/xhr.onerror@webpack-internal:///(app-pages-browser)/./node_modules/get-it/dist/index.browser.js:184:7

The logs show

 ✓ Compiled in 7.4s (4531 modules)
 GET /studio 200 in 214ms
 GET /favicon.ico 200 in 24ms

I also tried just doing yarn add @sanity/cli and then yarn sanity init --project ew7rp6z0 --dataset production --provider google but I'm ending up with the same thing.

I've confirmed that I'm logged in with the right user, and I've added the local host to the CORS (with the port).

I've also deployed this to vercel on a deployment link, added the link to the Sanity CORS, created a new admin user using a different email address, logged into Sanity on a new browser with the new email address and tried to visit the site again, same error.

pixel-toys-chris-evans commented 3 weeks ago

Did you ever get this resolved?

justincavery commented 3 weeks ago

Did you ever get this resolved?

From memory it had something to do with me including https:// on the local host when it was in fact only http://