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
Or you could pass it in your terminal as \`--compatibility-date ${compatibilityDateStr}\`
413
-
See https://developers.cloudflare.com/workers/platform/compatibility-dates for more information.`);
414
+
See https://developers.cloudflare.com/workers/platform/compatibility-dates for more information.`,
415
+
{telemetryMessage: "missing compatibiltiy date when deploying"}
416
+
);
414
417
}
415
418
416
419
constroutes=
@@ -495,25 +498,29 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
495
498
format==="service-worker"
496
499
){
497
500
thrownewUserError(
498
-
"You cannot use the service-worker format with an `assets` directory yet. For information on how to migrate to the module-worker format, see: https://developers.cloudflare.com/workers/learning/migrating-to-module-workers/"
501
+
"You cannot use the service-worker format with an `assets` directory yet. For information on how to migrate to the module-worker format, see: https://developers.cloudflare.com/workers/learning/migrating-to-module-workers/",
502
+
{telemetryMessage: true}
499
503
);
500
504
}
501
505
502
506
if(config.wasm_modules&&format==="modules"){
503
507
thrownewUserError(
504
-
"You cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code"
508
+
"You cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code",
509
+
{telemetryMessage: true}
505
510
);
506
511
}
507
512
508
513
if(config.text_blobs&&format==="modules"){
509
514
thrownewUserError(
510
-
`You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`
515
+
`You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`,
516
+
{telemetryMessage: "[text_blobs] with an ES module worker"}
511
517
);
512
518
}
513
519
514
520
if(config.data_blobs&&format==="modules"){
515
521
thrownewUserError(
516
-
`You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`
522
+
`You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`,
523
+
{telemetryMessage: "[data_blobs] with an ES module worker"}
517
524
);
518
525
}
519
526
@@ -969,7 +976,8 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
969
976
"binding DB of type d1 must have a valid `id` specified [code: 10021]"
970
977
){
971
978
thrownewUserError(
972
-
"You must use a real database in the database_id configuration. You can find your databases using 'wrangler d1 list', or read how to develop locally with D1 here: https://developers.cloudflare.com/d1/configuration/local-development"
979
+
"You must use a real database in the database_id configuration. You can find your databases using 'wrangler d1 list', or read how to develop locally with D1 here: https://developers.cloudflare.com/d1/configuration/local-development",
980
+
{telemetryMessage: true}
973
981
);
974
982
}
975
983
@@ -1133,7 +1141,8 @@ async function publishRoutesFallback(
1133
1141
if(notProd){
1134
1142
thrownewUserError(
1135
1143
"Service environments combined with an API token that doesn't have 'All Zones' permissions is not supported.\n"+
1136
-
"Either turn off service environments by setting `legacy_env = true`, creating an API token with 'All Zones' permissions, or logging in via OAuth"
1144
+
"Either turn off service environments by setting `legacy_env = true`, creating an API token with 'All Zones' permissions, or logging in via OAuth",
1145
+
{telemetryMessage: true}
1137
1146
);
1138
1147
}
1139
1148
logger.warn(
@@ -1213,7 +1222,8 @@ async function publishRoutesFallback(
1213
1222
continue;
1214
1223
}else{
1215
1224
thrownewUserError(
1216
-
`The route with pattern "${routePattern}" is already associated with another worker called "${knownScript}".`
1225
+
`The route with pattern "${routePattern}" is already associated with another worker called "${knownScript}".`,
1226
+
{telemetryMessage: "route already associated with another worker"}
1217
1227
);
1218
1228
}
1219
1229
}
@@ -1318,7 +1328,8 @@ export async function updateQueueConsumers(
1318
1328
if(scriptName===undefined){
1319
1329
// TODO: how can we reliably get the current script name?
1320
1330
thrownewUserError(
1321
-
"Script name is required to update queue consumers"
1331
+
"Script name is required to update queue consumers",
`The --node-compat flag is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`
230
+
`The --node-compat flag is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`,
Copy file name to clipboardExpand all lines: packages/wrangler/src/dev.ts
+11-3Lines changed: 11 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -890,7 +890,11 @@ export function getBindings(
890
890
// TODO: This error has to be a _lot_ better, ideally just asking
891
891
// to create a preview namespace for the user automatically
892
892
thrownewUserError(
893
-
`In development, you should use a separate kv namespace than the one you'd use in production. Please create a new kv namespace with "wrangler kv namespace create <name> --preview" and add its id as preview_id to the kv_namespace "${binding}" in your ${configFileName(configParam.configPath)} file`
893
+
`In development, you should use a separate kv namespace than the one you'd use in production. Please create a new kv namespace with "wrangler kv namespace create <name> --preview" and add its id as preview_id to the kv_namespace "${binding}" in your ${configFileName(configParam.configPath)} file`,
894
+
{
895
+
telemetryMessage:
896
+
"no preview kv namespace configured in remote dev",
897
+
}
894
898
);// Ugh, I really don't like this message very much
895
899
}
896
900
return{
@@ -946,7 +950,10 @@ export function getBindings(
946
950
// same copy-on-write TODO
947
951
if(!preview_bucket_name&&!local){
948
952
thrownewUserError(
949
-
`In development, you should use a separate r2 bucket than the one you'd use in production. Please create a new r2 bucket with "wrangler r2 bucket create <name>" and add its name as preview_bucket_name to the r2_buckets "${binding}" in your ${configFileName(configParam.configPath)} file`
953
+
`In development, you should use a separate r2 bucket than the one you'd use in production. Please create a new r2 bucket with "wrangler r2 bucket create <name>" and add its name as preview_bucket_name to the r2_buckets "${binding}" in your ${configFileName(configParam.configPath)} file`,
954
+
{
955
+
telemetryMessage: "no preview r2 bucket configured in remote dev",
956
+
}
950
957
);
951
958
}
952
959
return{
@@ -991,7 +998,8 @@ export function getBindings(
991
998
hyperdrive.localConnectionString===undefined
992
999
){
993
1000
thrownewUserError(
994
-
`When developing locally, you should use a local Postgres connection string to emulate Hyperdrive functionality. Please setup Postgres locally and set the value of the 'WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_${hyperdrive.binding}' variable or "${hyperdrive.binding}"'s "localConnectionString" to the Postgres connection string.`
1001
+
`When developing locally, you should use a local Postgres connection string to emulate Hyperdrive functionality. Please setup Postgres locally and set the value of the 'WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_${hyperdrive.binding}' variable or "${hyperdrive.binding}"'s "localConnectionString" to the Postgres connection string.`,
1002
+
{telemetryMessage: "no local hyperdrive connection string"}
Copy file name to clipboardExpand all lines: packages/wrangler/src/utils/print-bindings.ts
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -777,12 +777,18 @@ export function warnOrError(
777
777
){
778
778
if(remote===true&&supports==="local"){
779
779
thrownewUserError(
780
-
`${friendlyBindingNames[type]} bindings do not support accessing remote resources.`
780
+
`${friendlyBindingNames[type]} bindings do not support accessing remote resources.`,
781
+
{
782
+
telemetryMessage: true,
783
+
}
781
784
);
782
785
}
783
786
if(remote===false&&supports==="remote"){
784
787
thrownewUserError(
785
-
`${friendlyBindingNames[type]} bindings do not support local development. You may be able to set \`experimental_remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`
788
+
`${friendlyBindingNames[type]} bindings do not support local development. You may be able to set \`experimental_remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`,
0 commit comments