Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Troubleshooting a `sanity graphql deploy` error with a CLI upgrade/downgrade.

16 replies
Last updated: Jun 10, 2023
Trying to run a
sanity graphql deploy
but hitting this error…
ReferenceError: URL is not defined
…the stack trace isn’t helpful. Is there a verbose mode?
I don’t have an errant “URL” meant as a string. I’ve searched.

I’ve been sitting on a schema update (adding a field to a doc) for a while, so no recent relevant changes to look through.
Jun 9, 2023, 9:49 PM
What version of the CLI are you running?
Jun 9, 2023, 10:12 PM
I recently upgraded my cli to
3.10.1
while attempting an upgrade. That wen’t pretty badly, so I’m still using Sanity
2.30.1
…so perhaps I need to downgrade the cli.
Jun 9, 2023, 10:12 PM
🤔 Are you in a V2 or V3 Studio?
Jun 9, 2023, 10:17 PM
V2 still, the upgrade was no bueno.
Jun 9, 2023, 10:18 PM
I was hoping I could keep the fresh cli. No biggie.
Jun 9, 2023, 10:19 PM
Can you try upgrading to something like 2.35?
Jun 9, 2023, 10:19 PM
I could try.
Jun 9, 2023, 10:19 PM
sanity upgrade base@2.35
?
Jun 9, 2023, 10:21 PM
Ah, just the CLI
Jun 9, 2023, 10:21 PM
npm upgrade @sanity/cli@2.35
I believe
Jun 9, 2023, 10:23 PM
If it’s globally installed you’ll need to
-g
flag
Jun 9, 2023, 10:23 PM
I installed the new one globally and had the old one in the repo 😵‍💫
Jun 9, 2023, 10:41 PM
It ends up as
2.10.5
but it works!
Jun 9, 2023, 10:43 PM
Much appreciated.
Jun 9, 2023, 10:50 PM
Glad you got it working!
Jun 9, 2023, 10:51 PM
Is there any pro-services available to get upgraded to Sanity 3?
I made it part-way through the process, but didn’t feel confident about the config change-over… and still had a handful of plugins to get back in (after stripping it down to get it running at all).

Not a huge project, but a specialist would probably do it 5x faster than myself.
Jun 10, 2023, 9: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?