Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineCloudflareConfig } from '@opennextjs/cloudflare';

export default defineCloudflareConfig();
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
"test:build-latest-webpack": "pnpm install && pnpm add next@latest && pnpm build-webpack",
"test:build-canary-webpack": "pnpm install && pnpm add next@canary && pnpm build-webpack",
"test:assert": "pnpm test:prod && pnpm test:dev",
"test:assert-webpack": "pnpm test:prod && pnpm test:dev-webpack"
"test:assert-webpack": "pnpm test:prod && pnpm test:dev-webpack",
"test:build:cloudflare": "pnpm install && _SENTRY_TUNNEL_DESTINATION_OVERRIDE=http://localhost:3031/ opennextjs-cloudflare build",
Comment thread
JPeer264 marked this conversation as resolved.
"start:cloudflare": "opennextjs-cloudflare preview"
},
"dependencies": {
"@sentry/nextjs": "file:../../packed/sentry-nextjs-packed.tgz",
"@opennextjs/cloudflare": "^1.14.9",
"@sentry/core": "file:../../packed/sentry-core-packed.tgz",
"@sentry/nextjs": "file:../../packed/sentry-nextjs-packed.tgz",
"ai": "^3.0.0",
"import-in-the-middle": "^1",
"next": "16.2.11",
Expand All @@ -41,7 +44,8 @@
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "^16",
"typescript": "^5"
"typescript": "^5",
"wrangler": "^4.61.0"
},
"volta": {
"extends": "../../package.json"
Expand All @@ -58,6 +62,14 @@
"label": "nextjs-16-tunnel (turbopack)",
"assert-command": "pnpm test:assert"
}
],
"optionalVariants": [
{
"runtime": "cloudflare",
"build-command": "pnpm test:build:cloudflare",
"assert-command": "pnpm test:prod",
"label": "nextjs-16-tunnel (cloudflare)"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
import { getPlaywrightConfig, getRuntime } from '@sentry-internal/test-utils';
const testEnv = process.env.TEST_ENV;

if (!testEnv) {
Expand All @@ -15,7 +15,7 @@ const getStartCommand = () => {
}

if (testEnv === 'production') {
return 'pnpm next start -p 3030';
return getRuntime() === 'cloudflare' ? 'pnpm start:cloudflare --port 3030' : 'pnpm next start -p 3030';
}

throw new Error(`Unknown test env: ${testEnv}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as Sentry from '@sentry/nextjs/cloudflare';
// @ts-ignore the file exists only after `opennextjs-cloudflare build`
import handler from './.open-next/worker.js';

export default Sentry.withSentry(
() => ({
environment: 'qa', // dynamic sampling bias to keep transactions
dsn: 'https://public@o12345.ingest.us.sentry.io/67890',
// Sends the server spans to the proxy server, so the tests see whether a tunnel request was sampled.
tunnel: 'http://localhost:3031/',
tracesSampleRate: 1.0,
}),
handler,
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "nextjs-16-tunnel",
"main": "./worker.ts",
"compatibility_date": "2026-02-19",
"compatibility_flags": ["nodejs_compat"],
"assets": {
"binding": "ASSETS",
"directory": ".open-next/assets",
},
}
Loading