Skip to content

Conversation

@petebacondarwin
Copy link
Contributor

@petebacondarwin petebacondarwin commented Nov 4, 2025

This setup was tested locally by running the following commands:

cd templates/next
npm i
npm run preview

Notes:

  • npm is used here rather than pnpm since this package is not officially part of the monorepo
  • npm run preview does the open next build and then runs the project with wrangler - the project can also be run with npm run dev to use the classic Next.js dev server

@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2025

🦋 Changeset detected

Latest commit: 92a69e6

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 Minor

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 4, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/cloudflare@973

commit: 92a69e6


# wrangler files
.wrangler
!.dev.vars*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think .dev.vars* should be excluded (we might not do this in all examples for testing purposes)

Copy link
Contributor Author

@petebacondarwin petebacondarwin Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the project generated by C3 had it ignored in .gitignore but then in the docs for Open Next Cloudflare, I saw that it suggested you add this so that Next runs in dev mode locally...

https://opennext.js.org/cloudflare/get-started#5-add-a-devvars-file

So I thought it might be nice to include that...

But perhaps what we should do is include that in the template (by hard adding it) but then exclude it in the .gitignore file of the template so that it doesn't get git commited?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to .dev.vars.example and exclude in .gitignore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we leave it in the template but then ignore it in .gitignore?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that be a pain if we want to update the file at any point?

"$schema": "node_modules/wrangler/config-schema.json",
"name": "next",
"main": ".open-next/worker.js",
"compatibility_date": "2025-03-01",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably bump to the latest supported date in the installed wrangler

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change C3 to update this when it instantiates the template.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fixed date should be good for now IMO

@vicb
Copy link
Contributor

vicb commented Nov 4, 2025

Thanks Pete,
LGTM
Could you please add details on how this was tested in the PR description.
You also need to run pnpm fix


# typescript
*.tsbuildinfo
next-env.d.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should move this to the next.js section

.wrangler
.dev.vars*
!.dev.vars.example
!.env.example
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also move this to the next.js section (wrangler is setup to not process .env files with the adapter)

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.

3 participants