Troubleshooting dataset import and env variable issues with Vercel deployment
20 replies
Last updated: May 3, 2021
T
I exported my development dataset.Then I imported my development dataset into production.
Now I get this error message:
Does anyone know how to troubleshoot this?
Where can I find the name of the dataset?
Shouldn't it just be "production"?
Now I get this error message:
Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 20 characters
Where can I find the name of the dataset?
Shouldn't it just be "production"?
May 3, 2021, 9:14 PM
T
First i renamed development.tar.gz to production.tar.gzThen i ran:
sanity dataset import production.tar.gz production --replace
sanity dataset import production.tar.gz production --replace
May 3, 2021, 9:19 PM
T
And i gotDone! Imported 71 documents to dataset "production"
May 3, 2021, 9:19 PM
G
Interesting. I just did the exact same commands (just from production to dev) and it’s working. In sanity.json, is
api.dataset == "production"?
May 3, 2021, 9:38 PM
G
Interesting. I just did the exact same commands (just from production to dev) and it’s working. In sanity.json, is
api.dataset == "production"?
May 3, 2021, 9:38 PM
T
It actually works locally.But it does not work with Vercel.
I have the following env variable in Vercel
SANITY_STUDIO_API_DATASET
production sanity build
I have the following env variable in Vercel
SANITY_STUDIO_API_DATASET
production sanity build
May 3, 2021, 9:42 PM
T
I followed these instructions once in a time:
https://www.sanity.io/docs/studio-environment-variables
https://www.sanity.io/docs/studio-environment-variables
May 3, 2021, 9:42 PM
G
Is this your studio that you’re deploying to Vercel?
May 3, 2021, 9:50 PM
G
Is this your studio that you’re deploying to Vercel?
May 3, 2021, 9:50 PM
T
Yes
May 3, 2021, 9:50 PM
G
Did this ever work for you on your dev dataset? Or is this the first time you’ve tried deploying it?
May 3, 2021, 9:51 PM
G
Is the Vercel URL for your studio added in CORS Origins with credentials?
May 3, 2021, 9:51 PM
T
It has worked for over a year.And I have deployed the studio earlier today.
It stopped working after I imported the dataset.
It stopped working after I imported the dataset.
May 3, 2021, 9:53 PM
G
Okay, that’s good to know. I will try passing this up the chain.
May 3, 2021, 9:54 PM
T
Thanks 👍
May 3, 2021, 9:57 PM
G
Just to confirm, is this a build error (that therefore left production intact) or has it disrupted your production environment?
May 3, 2021, 9:58 PM
T
I don't get any build errors. And if I change something in the studio locally with "dataset": "production", I can see the changes in the production site.But I cannot access the sanity studio that is deployed to production.
May 3, 2021, 10:01 PM
T
I just tested to remove the env variable from Vercel and use "dataset": "production" in sanity.json and it works.There seems to be a problem with using the following env variable in Vercel.
SANITY_STUDIO_API_DATASET=production sanity build
May 3, 2021, 10:33 PM
G
Great! I’m confused how it worked before but happy it’s working for you. 🙌
May 3, 2021, 10:34 PM
T
I have just followed this part: https://www.sanity.io/docs/studio-environment-variables#4fab9317f4ad
I don't know if that solution has stopped working.
I don't know if that solution has stopped working.
May 3, 2021, 10:36 PM
T
I have just followed this part: https://www.sanity.io/docs/studio-environment-variables#4fab9317f4ad
I don't know if that solution has stopped working.
I don't know if that solution has stopped working.
May 3, 2021, 10:36 PM
Sanity– build remarkable experiences at scale
The Sanity Composable Content Cloud is the headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.