Next.js Discord

Discord Forum

Vercel env pull .env doesn't work, it puts me a wrong api key

Unanswered
Giant panda posted this in #help-forum
Open in Discord
Giant pandaOP
and the second problem i have is that in local all my project works, but when i go in production no api works

39 Replies

have you added your .env keys (the ones that are private) to your enviorment at your hoster?
Giant pandaOP
i'm going full vercel workflow
i have a pro plan with a blob store, i have this .env : BLOB_READ_WRITE_TOKEN="vercel_blob_rw_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
NX_DAEMON=""
TURBO_REMOTE_ONLY=""
TURBO_RUN_SUMMARY=""
VERCEL="1"
VERCEL_ENV="development"
VERCEL_GIT_COMMIT_AUTHOR_LOGIN=""
VERCEL_GIT_COMMIT_AUTHOR_NAME=""
VERCEL_GIT_COMMIT_MESSAGE=""
VERCEL_GIT_COMMIT_REF=""
VERCEL_GIT_COMMIT_SHA=""
VERCEL_GIT_PREVIOUS_SHA=""
VERCEL_GIT_PROVIDER=""
VERCEL_GIT_PULL_REQUEST_ID=""
VERCEL_GIT_REPO_ID=""
VERCEL_GIT_REPO_OWNER=""
VERCEL_GIT_REPO_SLUG=""
VERCEL_URL=""
this was created with vercel env pull .env
but i had to replace the BLOB_READ_WRITE_TOKEN
because it was not the right one that is displayed me in my storage settings
all was working, but when i upgraded to pro plan something happened
and now i cannot reach my store in production
only in local
maybe i have to replace this ? : VERCEL_ENV="development"
but i don't know, 1 day ago worked and it was set on development
hm that's weird. You also checked the values that are saved on vercel? Are these right?
Giant pandaOP
sorry i'm quite new, what values you mean?
the values from your .env. (see this value):
VERCEL_GIT_REPO_SLUG="this value"
VERCEL_URL="this value"
Giant pandaOP
do you have some link to a documentation where i can learn more about this?
so where can i find them, like vercel git repo just have to add the url of my repo and for vercel url the link that redirects to my website without my domain?
ok i set up it and i'm waiting for deployment
i will let you know if it works
nothing... it return me error 500
Giant pandaOP
so i re-tried all again with the normal workflow without modifying the blob read write token, and now it doesnt work anymore in local neither in production 😂
that's good. Because now you have only one issue and not 2 😉
Try checking the values of your env. variables and see if they are right ^^
Giant pandaOP
But what I don't understand is why the problem should improve if yesterday, with the hobby plan and the same values, there was no need for it
how can i help you understand better my situation? can i send you something?
oh i forgot to mention
when i made the pro plan my project was automatically transfered
but not my database
this is tricky because then i had to transfer the db manually
and then nothing worked after that, but only in production
in local all works perfectly
and yesterday worked in production too
so i checked VERCEL_GIT_REPO_SLUG
VERCEL_URL and they are correct, but same error 500 in production
if i delete all and remake everything you think it will work?
maybe i was just unlucky
what i did was: hobby plan, deploy of the website and blob store
then upgrade to pro plan
transfered the blob store
and this error happened
Giant pandaOP
I solved the problem; I deleted the store I had transferred and created a new one, then re-uploaded all the data. Fortunately, I only had a couple of images, but I think it would have been a disaster if I had a database full of data. need to check something in the workflow because there are errors when transferring projects from a basic plan to a pro plan
please mark solution