We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9808377 commit 6b84134Copy full SHA for 6b84134
1 file changed
bundler-tests/browser/nextjs-16-edge/next.test.ts
@@ -0,0 +1,22 @@
1
+/**
2
+ * Next.js 16+ uses Turbopack, which lacks callbacks for build errors or warnings.
3
+ * This script runs the build and fails if Turbopack reports any warnings.
4
+ */
5
+import { execSync } from 'node:child_process';
6
+import path from 'node:path';
7
+
8
+const testDir = path.dirname(new URL(import.meta.url).pathname);
9
10
+// Install dependencies and run build, capturing both stdout and stderr
11
+const output = execSync('npm run build 2>&1', {
12
+ cwd: testDir,
13
+ encoding: 'utf-8',
14
+});
15
16
+const hasWarning = /Turbopack build encountered/.test(output);
17
+if (hasWarning) {
18
+ console.error('Build produced warnings:\n', output);
19
+ process.exit(1);
20
+}
21
22
+console.log('Build completed without warnings');
0 commit comments