Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about initOpenNextCloudflareForDev #288

Closed
vicb opened this issue Jan 28, 2025 · 3 comments · Fixed by #305
Closed

Question about initOpenNextCloudflareForDev #288

vicb opened this issue Jan 28, 2025 · 3 comments · Fixed by #305
Assignees

Comments

@vicb
Copy link
Contributor

vicb commented Jan 28, 2025

@dario-piotrowicz I noticed that Using vars defined in .dev.vars is printed multiple times with next dev, see for example the output in the examples/api app:

-> % pnpm dev

> [email protected] dev /Users/vberchet/code/work/opennextjs-cloudflare/examples/api
> next dev

Using vars defined in .dev.vars
Using vars defined in .dev.vars
  ▲ Next.js 14.2.11
  - Local:        http://localhost:3000
  - Environments: .env.development

 ✓ Starting...
Using vars defined in .dev.vars
Using vars defined in .dev.vars
 ✓ Ready in 1546ms

I'm wondering if this is expected?

Do we start wrangler multiple times? If yex, would there be a way to start it only once?

@dario-piotrowicz
Copy link
Contributor

oh, I didn't notice that, let me have a quick look 👍

@dario-piotrowicz
Copy link
Contributor

There are two issues here, one is that next dev imports the module twice in two distinct processes, so we basically call wrangler's getPlatformProxy twice, I will open a PR for fixing that in a few minutes, I just need to copy over this piece of code we had in next-on-pages: shouldSetupContinue() (sorry I should have remembered and copied it over already in #265 😓).

The other issue is an actual upstream wrangler one, it looks like calling getPlatformProxy with a .dev.vars file present causes a double log of the Using vars defined in .dev.vars message: cloudflare/workers-sdk#7944 (I can also have a quick look into that there)

@dario-piotrowicz
Copy link
Contributor

With #293 and #305 this issue is resolved for next dev

However we do get various Using vars defined in .dev.vars when building the application 😓:
Image

@vicb vicb closed this as completed in #305 Jan 30, 2025
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 a pull request may close this issue.

2 participants