You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wrangler: feat: validate Worker subdomain mixed state (#10770)
Enabling or disabling `workers_dev` is often an indication that
the user is also trying to enable or disable `preview_urls`. Warn the
user when these enter mixed state.
// Scenario 1: User disables workers.dev while having preview URLs enabled
366
+
if(!desired.workers_dev&&desired.preview_urls){
367
+
logger.warn(
368
+
[
369
+
"You are disabling the 'workers.dev' subdomain for this Worker, but Preview URLs are still enabled.",
370
+
"Preview URLs will automatically generate a unique, shareable link for each new version which will be accessible at:",
371
+
` ${previewUrl}`,
372
+
"",
373
+
"To prevent this Worker from being unintentionally public, you may want to disable the Preview URLs as well by setting `preview_urls = false` in your Wrangler config file.",
374
+
].join("\n")
375
+
);
376
+
}
377
+
378
+
// Scenario 2: User enables workers.dev when Preview URLs are off
379
+
if(desired.workers_dev&&!desired.preview_urls){
380
+
logger.warn(
381
+
[
382
+
"You are enabling the 'workers.dev' subdomain for this Worker, but Preview URLs are still disabled.",
383
+
"Preview URLs will automatically generate a unique, shareable link for each new version which will be accessible at:",
384
+
` ${previewUrl}`,
385
+
"",
386
+
"You may want to enable the Preview URLs as well by setting `preview_urls = true` in your Wrangler config file.",
387
+
].join("\n")
388
+
);
389
+
}
390
+
391
+
returndesired;
392
+
}
393
+
313
394
asyncfunctionsubdomainDeploy(
314
395
props: Props,
315
396
accountId: string,
@@ -322,11 +403,6 @@ async function subdomainDeploy(
0 commit comments