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
Return structured configuration errors from `wrangler preview --json`
6
+
7
+
When a Worker is missing its Preview configuration, JSON mode now returns an `error`, a `suggested_config` patch, and any associated onboarding `messages` without interactive output or terminal formatting. This changes the private-beta Preview command to make automated onboarding reliable.
'Your Wrangler configuration is missing a `previews` block to run this command. Add the following to your configuration file:\n{\n "previews": {}\n}\nTo create or update a Preview with `npx wrangler preview`, your Wrangler configuration must include a `previews` block. The block can be empty. Assets, compatibility settings, migrations, and placement stay at the top level and do not need to be added to `previews`.\nLearn more: https://developers.cloudflare.com/workers/previews/configuration/#wrangler-configuration-file'
1647
-
);
1649
+
).rejects.toThrow("missing a previews block");
1648
1650
1649
1651
expect(deploymentRequests).toBe(0);
1650
-
expect(std.out).toBe("");
1652
+
expect(JSON.parse(std.out)).toEqual({
1653
+
error: "Your Wrangler configuration is missing a previews block",
0 commit comments