Skip to content

Conversation

james-elicx
Copy link
Collaborator

Context

Draft mode tries to access certain environment variables in the edge runtime to be able to work. These variables are available in the prerender manifest and need to be injected into the worker some how.

fixes #94 (?)

Changes

  • Move prerender manifest retrieval to a utility.
  • Inject the preview mode config.
  • Add the draft mode env vars to process.env inside the worker.

Copy link

changeset-bot bot commented Oct 12, 2024

🦋 Changeset detected

Latest commit: fc118eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@james-elicx james-elicx changed the title refactor: move prerender manifest retrieval to own utility fix: draft mode env vars not available Oct 12, 2024
Copy link

pkg-pr-new bot commented Oct 12, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/cloudflare@97

commit: fc118eb

@james-elicx james-elicx mentioned this pull request Oct 12, 2024
@james-elicx james-elicx deleted the james/fix-draft-mode branch December 19, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Draft mode

1 participant