-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(nextjs): Added nextjs CF workers test app #18928
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
base: develop
Are you sure you want to change the base?
test(nextjs): Added nextjs CF workers test app #18928
Conversation
There was a problem hiding this 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.
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.
proxyfilename not being picked up by opennext, yetmiddlewareworks on Next 16 😕transaction_info.sourceis'url'instead of'route''resolve segment modules'instead of specific component names)http.response.status_code/http.status_codeattributesI 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)