-
Notifications
You must be signed in to change notification settings - Fork 27.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cms-sanity] Add NEXT_PUBLIC_
to readme env variables
#14792
Milestone
Comments
Maybach91
added a commit
to Maybach91/next.js
that referenced
this issue
Jul 3, 2020
* To run nextjs and sanity locally we need to define a `NEXT_PUBLIC_SANITY_PROJECT_ID` as environment variable. [reference](https://nextjs.org/docs/basic-features/environment-variables#exposing-environment-variables-to-the-browser) * Also use this variable only, when run in development node environment. [14792](vercel#14792)
Maybach91
added a commit
to Maybach91/next.js
that referenced
this issue
Jul 3, 2020
…hema file To avoid confusion why there are two folders with the same name within the whole project, we should add the `example` to the schema file which is only used to store within the project to copy it to sanity after successful installation. [14792](vercel#14792)
4 tasks
rokinsky
pushed a commit
to rokinsky/next.js
that referenced
this issue
Jul 11, 2020
Fixes vercel#14792 Closes vercel#14814 The project id is currently used by Sanity's image builder, which is used in a React component. @maybac It was faster for me to create a new PR but the credit goes to you, thank you!.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
Step 4 of the readme says, i have to create a env variable named
SANITY_PROJECT_ID
but to work locally withyarn dev
it has to beNEXT_PUBLIC_SANITY_PROJECT_ID
(as well?)Since i was not aware of this part of the next.js config, i was confused why it wasn’t working. Since i could access all env variables within my code, but not on runtime.
To Reproduce
Follow the steps of the Readme to install & run the example.
Expected behavior
Follow the readme and have a functioning project running with
yarn dev
Screenshots
Without the
NEXT_PUBLIC_SANITY_PROJECT_ID
variable in the.env.local
file:System information
The text was updated successfully, but these errors were encountered: