From 84dbedc4026b795ffa33c873ce89a2f83fb6edba Mon Sep 17 00:00:00 2001 From: Zane Chua <4265429+zanechua@users.noreply.github.com> Date: Sun, 3 Jul 2022 13:19:38 +0800 Subject: [PATCH 1/3] Update edge-runtime.md --- docs/api-reference/edge-runtime.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/api-reference/edge-runtime.md b/docs/api-reference/edge-runtime.md index 6e77d4140e3c..8c8563858e1c 100644 --- a/docs/api-reference/edge-runtime.md +++ b/docs/api-reference/edge-runtime.md @@ -115,6 +115,15 @@ The Next.js Edge Runtime is based on standard Web APIs, which is used by [Middle You can use `process.env` to access [Environment Variables](/docs/basic-features/environment-variables.md) for both `next dev` and `next build`. +Running `console.log` on `process.env` will not show all your environment variables, you have to access the variables directly before they are shown in `process.env` + +```javascript +console.log(process.env); +// { NEXT_RUNTIME: 'edge' } +console.log(process.env.TEST_VARIABLE); +// { NEXT_RUNTIME: 'edge', TEST_VARIABLE: 'value' } +``` + ## Unsupported APIs The Edge Runtime has some restrictions including: From c36253025baec92b8589577123397ded59848558 Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Sun, 3 Jul 2022 23:01:13 -0500 Subject: [PATCH 2/3] Update docs/api-reference/edge-runtime.md --- docs/api-reference/edge-runtime.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-reference/edge-runtime.md b/docs/api-reference/edge-runtime.md index 8c8563858e1c..74f0bfd9bf90 100644 --- a/docs/api-reference/edge-runtime.md +++ b/docs/api-reference/edge-runtime.md @@ -115,7 +115,7 @@ The Next.js Edge Runtime is based on standard Web APIs, which is used by [Middle You can use `process.env` to access [Environment Variables](/docs/basic-features/environment-variables.md) for both `next dev` and `next build`. -Running `console.log` on `process.env` will not show all your environment variables, you have to access the variables directly before they are shown in `process.env` +Running `console.log` on `process.env` **will not** show all your Environment Variables. You have to access the variables directly as shown below: ```javascript console.log(process.env); From f8baf2066287556a19a4544dfad13b37cb564adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Wed, 6 Jul 2022 16:08:14 +0200 Subject: [PATCH 3/3] fix linting --- docs/api-reference/edge-runtime.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-reference/edge-runtime.md b/docs/api-reference/edge-runtime.md index 74f0bfd9bf90..c62a84973bf4 100644 --- a/docs/api-reference/edge-runtime.md +++ b/docs/api-reference/edge-runtime.md @@ -118,9 +118,9 @@ You can use `process.env` to access [Environment Variables](/docs/basic-features Running `console.log` on `process.env` **will not** show all your Environment Variables. You have to access the variables directly as shown below: ```javascript -console.log(process.env); +console.log(process.env) // { NEXT_RUNTIME: 'edge' } -console.log(process.env.TEST_VARIABLE); +console.log(process.env.TEST_VARIABLE) // { NEXT_RUNTIME: 'edge', TEST_VARIABLE: 'value' } ```