NEXT JS 15 - Sanity 3 - API Problem
Unanswered
Cory's Shearwater posted this in #help-forum
Cory's ShearwaterOP
In my next js - sanity app, my sanity studio is showing error SANITY_TOKEN_API is missing.
In the /sanity/env.ts when I log the /.env token, its undefined on client, but defined on server.
When i remove it from assertValue(), it works, but cant understand this behavior.
Any Solve.
In the /sanity/env.ts when I log the /.env token, its undefined on client, but defined on server.
When i remove it from assertValue(), it works, but cant understand this behavior.
Any Solve.
1 Reply
Mugger Crocodile
The environment file (.env) should be placed at the root directly where your next config file is located or in src/ if you are using src directory.