docs(cloudflare): document populateCache setup behind Cloudflare Access#218
Merged
Conversation
Adds a sub-section to the CLI docs explaining how to make `populateCache remote` (and the `deploy` / `upload` commands that call it) work when the temporary `open-next-cache-populate` helper Worker is fronted by a Cloudflare Access application, plus a cross-linked troubleshooting entry for the two error messages users typically see in this scenario. The previous guidance (only present in the v1.19.10 changelog entry) was ambiguous about whether to create a new Access application or attach the policy to an existing one. Per the discussion in opennextjs/opennextjs-cloudflare#1171, attaching the Service Auth policy to the existing application that already covers the hostname is the working path; creating a separate application scoped to `open-next-cache-populate.<account>.workers.dev` has been observed to block the upload even alongside the existing wildcard app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pages/cloudflare/cli.mdxunder thepopulateCachecommand, explaining what to do when the temporaryopen-next-cache-populate.<account>.workers.devhelper Worker is fronted by a Cloudflare Access application (the scenario introduced by Allow populating R2 when the domain is protected by Cloudflare Access opennextjs-cloudflare#1261).pages/cloudflare/troubleshooting.mdxfor the two error messages users typically hit in this scenario (Failed to send request to R2 workerandCould not determine Cloudflare auth credentials after login).Why
The only existing guidance for this setup is the
@opennextjs/cloudflarev1.19.10 changelog entry, which reads:That phrasing is ambiguous about whether to create a new Access application for the hostname or attach the policy to an existing application that already covers it. The discussion in opennextjs/opennextjs-cloudflare#1171 (comment #4460317679) shows multiple users falling into the same trap. The user that eventually got it working reported:
The new sub-section captures that — phrased as observed behaviour rather than a hard rule, since we don't yet know the root cause of why the separate-application setup blocks the upload.
Notes
npx prettier@3.5.2 --check pages/cloudflare/cli.mdx pages/cloudflare/troubleshooting.mdx).####) so it nests under the existing### populateCache commandsection in the page TOC.populate-cache.tsis being updated in a separate PR on opennextjs/opennextjs-cloudflare so future maintainers don't re-introduce the ambiguous wording in changelogs.