Skip to content

Commit 8f30d41

Browse files
committed
fix: add warning when subdomain status does not match Wrangler config
Warn the user when the workers.dev or preview URLs status does not match their Wrangler config file.
1 parent e00b998 commit 8f30d41

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/wrangler/src/triggers/deploy.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,28 @@ async function subdomainDeploy(
329329
const previewsInSync = wantPreviews === currPreviews;
330330
const allInSync = [workersDevInSync, previewsInSync].every((v) => v);
331331

332+
// Warn about mismatching config and current values.
333+
334+
if (config.workers_dev == undefined && !workersDevInSync) {
335+
const currWorkersDevStatus = currWorkersDev ? "enabled" : "disabled";
336+
logger.warn(
337+
[
338+
`Worker has workers.dev ${currWorkersDevStatus}, but 'workers_dev' is not in the config.`,
339+
`Using fallback value 'workers_dev = ${wantWorkersDev}'.`,
340+
].join("\n")
341+
);
342+
}
343+
344+
if (config.preview_urls == undefined && !previewsInSync) {
345+
const currPreviewsStatus = currPreviews ? "enabled" : "disabled";
346+
logger.warn(
347+
[
348+
`Worker has preview URLs ${currPreviewsStatus}, but 'preview_urls' is not in the config.`,
349+
`Using fallback value 'preview_urls = ${wantPreviews}'.`,
350+
].join("\n")
351+
);
352+
}
353+
332354
// workers.dev URL is only set if we want to deploy to workers.dev.
333355

334356
let workersDevURL: string | undefined;

0 commit comments

Comments
 (0)