So in my case, there was a new folder created in the project root. The folder name was "studio-****". Inside it was a new .env.local file.
It had the environment variables in a different format with "" around the variables: NEXT_PUBLIC_SANITY_PROJECT_ID="********" NEXT_PUBLIC_SANITY_DATASET="production"
I copied these variables to the .env.local file in the root folder and my app worked immediately.