publish_date | tags | |
---|---|---|
2022-04-22 |
|
- You cant destructure
process.env
in next.js apps
Note: In order to keep server-only secrets safe, Next.js replaces聽
process.env.*
聽with the correct values at build time. This means that聽process.env
聽is not a standard JavaScript object, so you鈥檙e not able to use聽object destructuring. Environment variables must be referenced as e.g.聽process.env.PUBLISHABLE_KEY
,聽not聽const { PUBLISHABLE_KEY } = process.env
.