Open trulymittal opened 7 months ago
sanity deploy
is for standalone Vite-based Studios. This is a Remix project with an embedded Studio, designed to be deployed to Vercel for hosting.
@SimeonGriggs I understand that sanity deploy
is for standalone projects, but in that case the recently released sanity schema extract
as well as sanity typegen generate
would also fail because of the above mentioned issue. Also to note is that sanity build
also fails for the same reason.
Moreover, deploying to sanity cloud is a basic stuff that the next-studio
or any other integration (afaik) of sanity does for sanity, Imo this should be supported.
Any help would be greatly appreciated.
Right. So yes the way this project is currently setup, any CLI commands that need to access sanity.config.ts
will fail because of the way the projectId
and dataset
variables are accessed.
Opening because it would be beneficial to have this fixed for commands like sanity schema extract
and sanity graphql deploy
but sanity deploy
will not be supported.
Hi Simeon, I'm trying to use the groq typegen instead of zod on this template but running into the issue described. I thought loading the needed variables into the process would work, but I cannot get it to work. I've tried something like:
"typegen": "dotenvx run -f .env.local -- pnpm sanity schema extract"
but somehow the sanity command doesn't pick up on the variables... any ideas for a fix? because process is undefined it tries to read the import.meta.env.VITE_
variables but that doesn't work either because we're not in vite context.
Simply cloning the clean repo and trying to build by doing
npx sanity build
orsanity build
, OR trying to deploy the sanity studio by doingnpx sanity deploy
orsanity deploy
, it fails with vite errors... I dunno where and what I am getting wrong at, I have tried cloning multiple times but everytime the same issue, pnpm/bun both fails with same errors...Most importantly all the errors are related to vite
Even after hard coding the project id and dataset, running
npx sanity deploy
I get this error