Skip to content

Conversation

@logaretm
Copy link
Collaborator

@logaretm logaretm commented Jan 21, 2026

This PR sets up E2E tests for Next.js 16 running on Cloudflare Workers using OpenNext.

Some tests yield different transaction names and span attributes, I will review each of the skipped tests and review the differences and if we should either consolidate the edge runtime behavior with the node runtime behavior.

Known Limitations

Those are the test failures that required skipping.

  • Middleware proxy filename not being picked up by opennext, yet middleware works on Next 16 😕
  • HTTP request headers not extracted as span attributes
  • Metrics not emitting on Cloudflare Workers
  • Middleware transaction_info.source is 'url' instead of 'route'
  • Server component spans have different names (e.g., 'resolve segment modules' instead of specific component names)
  • Missing http.response.status_code / http.status_code attributes

I plan to follow up with another PR to address these, but the higher priority is making sure the SDK doesn't crash and works to some degree on CF worker apps.

Closes #18929 (added automatically)

@logaretm logaretm requested review from chargome and Copilot January 21, 2026 20:12
@linear
Copy link

linear bot commented Jan 21, 2026

@logaretm logaretm changed the title test: Added nextjs CF workers test app test(nextjs): Added nextjs CF workers test app Jan 21, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds E2E tests for Next.js 16 running on Cloudflare Workers using OpenNext. The primary goal is to verify that the Sentry SDK doesn't crash when running in this environment, with several tests intentionally skipped due to known limitations in the CF Workers runtime.

Changes:

  • New test application configuration for Next.js 16 on Cloudflare Workers with OpenNext
  • Comprehensive test suite covering various Next.js features (middleware, server components, route handlers, ISR, metrics)
  • Multiple tests are skipped with TODOs noting CF Workers-specific limitations

Reviewed changes

Copilot reviewed 57 out of 63 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
wrangler.jsonc Cloudflare Workers configuration with nodejs_compat and asset bindings
package.json Dependencies and build scripts for CF Workers deployment
tsconfig.json TypeScript configuration for the test application
next.config.ts Next.js configuration with Sentry integration
open-next.config.ts OpenNext configuration for Cloudflare deployment
playwright.config.mjs Playwright test configuration
sentry.server.config.ts Server-side Sentry configuration
sentry.edge.config.ts Edge runtime Sentry configuration
instrumentation.ts Server instrumentation with onRequestError hook
instrumentation-client.ts Client-side instrumentation
middleware.ts Edge middleware implementation
tests/*.test.ts Test files covering various Next.js features with CF Workers
app/* Test application pages, layouts, and route handlers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@logaretm logaretm requested a review from andreiborza January 23, 2026 14:52
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.

test: Added nextjs CF workers test app

2 participants