-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support Next.js in autoconfig and also delegate to open-next for wrangler deploy runs executed in open-next projects
#11301
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
Conversation
🦋 Changeset detectedLatest commit: 38859dc The changes in this PR will be included in the next version bump. 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 |
e1a384a to
31e5296
Compare
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
31e5296 to
20d1242
Compare
20d1242 to
a2f24b5
Compare
b1d0f1b to
ba94707
Compare
a2f24b5 to
a087f96
Compare
a087f96 to
db411f0
Compare
|
Converting to draft since the C3 e2es don't currently run in CI and we should enable them before merging and new C3 autoconfig PR |
db411f0 to
9845bde
Compare
|
When I tried this locally, with a new project, I got "✘ [ERROR] The entry-point file at ".open-next/worker.js" was not found.". I needed to do another |
|
The issue is that it doesn't run |
|
Should it change the build command? |
69a48af to
73871b5
Compare
oh... yeah I see the issue.... that's annoying.... I don't think we could change the |
73871b5 to
0927724
Compare
|
I think these changes should be in a separate PR. Will they then override the package.json build command too? |
Co-authored-by: Somhairle MacLeòid <[email protected]>
541281c to
3e2729c
Compare
|
I’ll try to create a minimal reproduction later, but I think the open-next project detection might be too permissive. I have a Wrangler config at the repo root that deploys an Astro app. Then I have a workspace with a Next.js app that uses open-next. The issue is that when I deploy the root app, it gets identified as an open-next project, which is incorrect, and it results in this error:
See https://github.com/ariakit/ariakit/actions/runs/20287760629/job/58265344982 |
|
Do you have this documented somewhere? Because in my case, the new Wrangler version (4.55.0) is not respecting the deployment parameters, such as As showing below, first it runs Wrangler deploy with some parameters, then it calls |
|
This change just took down a production site because --env wasn't passed to the opennext deploy. When it failed, it assigned the prod custom domains to our staging env and stole them from the prod deploy. This happened completely isolated in the staging worker. The cloudflare infra just let a config value take the custom domains from our prod instance and apply them to the staging instance like it was no problem. meanwhile the sites that used routes instead failed with an error saying the route was already in use |
|
@dario-piotrowicz We deploy our apps to Workers for Platforms by setting --dispatch-namespace for |
|
@pliashkou you can temporarily pin your wrangler version to 4.54 to avoid this. To do this you can specifically target the version of wrangler via |
|
@diegohaz @jkribeiro - see the above comment re: pinning to 4.54. we have deprecated 4.55 and 4.56 due to this regression. |
…ngler deploy` runs executed in open-next projects (cloudflare#11301) * Support Next.js in autoconfig * Update packages/wrangler/src/autoconfig/frameworks/next.ts Co-authored-by: Somhairle MacLeòid <[email protected]> * update `AutoConfigFrameworkConfigurationError` class to extend `UserError` * add WORKER_SELF_REFERENCE service config * delegate deploy to open-next for open-next projects * move next to the right framework position * move scripts to `packageJsonScriptsOverrides` * fix packageJsonScriptsOverrides not being passed to buildOperationsSummary * add OpenNext to changesets * improve jsdoc comment for `maybeDelegateToOpenNextDeployCommand` * update OpenNext log * test whole `std` with single `toMatchInlineSnapshot` * rename probeForNextConfigPath to findNextConfigPath * Update packages/wrangler/src/deploy/open-next.ts Co-authored-by: Somhairle MacLeòid <[email protected]> * move `OPEN_NEXT_DEPLOY` to `misc-variables` * move openNext delegation after autoconfig logic * simplify comment --------- Co-authored-by: Somhairle MacLeòid <[email protected]>

Fixes https://jira.cfdata.org/browse/DEVX-2321