Skip to content

fix(nextjs): add missing dependencies in nextjs_standalone_server#2890

Merged
acozzette merged 3 commits into
mainfrom
adamc/nextjs-test
Jun 15, 2026
Merged

fix(nextjs): add missing dependencies in nextjs_standalone_server#2890
acozzette merged 3 commits into
mainfrom
adamc/nextjs-test

Conversation

@acozzette

@acozzette acozzette commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Adds a server_test to examples/nextjs that starts the standalone server binary and polls for an HTTP response, catching potential regressions where the build succeeds but the server fails to run.

This turned up some issues where we had some missing dependencies. These would not necessarily be easy to catch with manual testing, since "bazel run" does not use a sandbox and can therefore succeed even when important dependencies are absent. The most important thing was making sure the js_binary takes a dependency on the actual sources produced by next build.


Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: yes
  • Breaking change (forces users to change their own code or config): no
  • Suggested release notes appear below: yes

Fix handling of dependencies in nextjs_standalone_server()

Test plan

  • Covered by existing test cases
  • New test cases added

acozzette and others added 2 commits June 15, 2026 14:04
Adds a server_test to examples/nextjs that starts the standalone server binary
and polls for an HTTP response, catching potential regressions where the build
succeeds but the server fails to run.

This turned up some issues where we had some missing dependencies. These would
not necessarily be easy to catch with manual testing, since "bazel run" does
not use a sandbox and can therefore succeed even when important dependencies
are absent. The most important thing was making sure the `js_binary` takes a
dependency on the actual sources produced by `next build`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread contrib/nextjs/defs.bzl
@acozzette acozzette changed the title test(nextjs): add sh_test that runs the standalone server fix(nextjs): add sh_test that runs the standalone server Jun 15, 2026
@acozzette acozzette changed the title fix(nextjs): add sh_test that runs the standalone server fix(nextjs): add missing dependencies in nextjs_standalone_server Jun 15, 2026
Comment thread examples/nextjs/server_test.sh
@acozzette acozzette merged commit 346b695 into main Jun 15, 2026
170 checks passed
@acozzette acozzette deleted the adamc/nextjs-test branch June 15, 2026 21:57
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.

2 participants