/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v16.3.0
errors/missing-env-value.mdx
21 строка
884 B
Delba de Oliveira
docs: Migrate error messages to MDX and App Router. (#52038)
05 июл 2023, 16:11
Не верифицирован
05 июл 2023, 16:11
44d1a1c
Код
Авторство
О чём код?
--- title: Missing Env Value --- ## Why This Error Occurred In one of your pages you attempted to access an environment value that is not provided in the environment. When accessing environment variables on the client they must be prefixed with `NEXT_PUBLIC_` to signify they are safe to be inlined for the client. When accessing environment variables on the server in `getStaticProps`, `getServerSideProps`, or an API route the value must be provided in the environment at runtime. ## Possible Ways to Fix It Either remove the code accessing the env value, populate it in your `.env` file, or manually populate it in your environment before running `next dev` or `next build`. ## Useful Links - [dotenv](https://npmjs.com/package/dotenv) - [dotenv-expand](https://npmjs.com/package/dotenv-expand) - [Environment Variables](https://en.wikipedia.org/wiki/Environment_variable)