this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

output more wrangler command logs on errors (#1034)

authored by

James Anderson and committed by
GitHub
721bff02 7159f6f1

+13 -2
+5
.changeset/fresh-taxis-pay.md
··· 1 + --- 2 + "@opennextjs/cloudflare": patch 3 + --- 4 + 5 + output more wrangler command logs when the command fails
+8 -2
packages/cloudflare/src/cli/utils/run-wrangler.ts
··· 56 56 } 57 57 58 58 export function runWrangler(options: BuildOptions, args: string[], wranglerOpts: WranglerOptions = {}) { 59 + const shouldPipeLogs = wranglerOpts.logging === "error"; 60 + 59 61 const result = spawnSync( 60 62 options.packager, 61 63 [ ··· 74 76 ], 75 77 { 76 78 shell: true, 77 - stdio: wranglerOpts.logging === "error" ? ["ignore", "ignore", "inherit"] : "inherit", 79 + stdio: shouldPipeLogs ? ["ignore", "pipe", "pipe"] : "inherit", 78 80 env: { 79 81 ...process.env, 80 - ...(wranglerOpts.logging === "error" ? { WRANGLER_LOG: "error" } : undefined), 81 82 // `.env` files are handled by the adapter. 82 83 // Wrangler would load `.env.<wrangler env>` while we should load `.env.<process.env.NEXTJS_ENV>` 83 84 // See https://opennext.js.org/cloudflare/howtos/env-vars ··· 87 88 ); 88 89 89 90 if (result.status !== 0) { 91 + if (shouldPipeLogs) { 92 + process.stdout.write(result.stdout.toString()); 93 + process.stderr.write(result.stderr.toString()); 94 + } 95 + 90 96 logger.error("Wrangler command failed"); 91 97 process.exit(1); 92 98 }