Skip to content

Commit 4b405ff

Browse files
committed
docs(nextjs): adding workers builds env secret requirement
1 parent 5e320f3 commit 4b405ff

File tree

1 file changed

+21
-0
lines changed
  • src/content/docs/workers/framework-guides/web-apps

1 file changed

+21
-0
lines changed

src/content/docs/workers/framework-guides/web-apps/nextjs.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ Most Next.js features are supported by the Cloudflare OpenNext adapter:
102102

103103
<PackageManagers type="run" args="deploy" />
104104

105+
:::note
106+
[**Workers Builds**](/workers/ci-cd/builds/) requires you to configure environment variables in the ["Build Variables and secrets"](/workers/ci-cd/builds/configuration/#:~:text=Build%20variables%20and%20secrets) section.
107+
108+
109+
This ensures the Next build has the necessary access to both public `NEXT_PUBLC...` variables and [non-`NEXT_PUBLIC_...`](https://nextjs.org/docs/pages/guides/environment-variables#bundling-environment-variables-for-the-browser), which are essential for tasks like inlining and building SSG pages.
110+
111+
112+
Learn more in the [OpenNext environment variable guide](https://opennext.js.org/cloudflare/howtos/env-vars#workers-builds)
113+
:::
114+
105115
</Steps>
106116

107117
## Deploy an existing Next.js project on Workers
@@ -192,4 +202,15 @@ You can convert an existing Next.js application to run on Cloudflare
192202

193203
<PackageManagers type="run" args="deploy" />
194204

205+
:::note
206+
[**Workers Builds**](/workers/ci-cd/builds/) requires you to configure environment variables in the ["Build Variables and secrets"](/workers/ci-cd/builds/configuration/#:~:text=Build%20variables%20and%20secrets) section.
207+
208+
209+
This ensures the Next build has the necessary access to both public `NEXT_PUBLC...` variables and [non-`NEXT_PUBLIC_...`](https://nextjs.org/docs/pages/guides/environment-variables#bundling-environment-variables-for-the-browser), which are essential for tasks like inlining and building SSG pages.
210+
211+
212+
Learn more in the [OpenNext environment variable guide](https://opennext.js.org/cloudflare/howtos/env-vars#workers-builds)
213+
:::
214+
215+
195216
</Steps>

0 commit comments

Comments
 (0)