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
fix: do not crash in wrangler dev if user has multiple accounts
When a user has multiple accounts we show a prompt to allow the user to select which they should use.
This was broken in `wrangler dev` as we were trying to start a new ink.js app (to show the prompt)
from inside a running ink.js app (the UI for `wrangler dev`).
This fix refactors the `ChooseAccount` component so that it can be used directly within another component.
Fixes#1258
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mFailed to automatically retrieve account IDs for the logged in user. In a non-interactive environment, it is mandatory to specify an account ID, either by assigning its value to CLOUDFLARE_ACCOUNT_ID, or as \`account_id\` in your \`wrangler.toml\` file.[0m
253
+
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mFailed to automatically retrieve account IDs for the logged in user.[0m
254
+
255
+
In a non-interactive environment, it is mandatory to specify an account ID, either by assigning
256
+
its value to CLOUDFLARE_ACCOUNT_ID, or as \`account_id\` in your \`wrangler.toml\` file.
it("should error if a user has no account",async()=>{
216
-
mockGetMemberships({
217
-
success: false,
218
-
result: [],
219
-
});
220
-
awaitexpect(
221
-
runWrangler("secret put the-key --name script-name")
222
-
).rejects.toThrowErrorMatchingInlineSnapshot(
223
-
`"Failed to automatically retrieve account IDs for the logged in user. In a non-interactive environment, it is mandatory to specify an account ID, either by assigning its value to CLOUDFLARE_ACCOUNT_ID, or as \`account_id\` in your \`wrangler.toml\` file."`
224
-
);
215
+
mockGetMemberships([]);
216
+
awaitexpect(runWrangler("secret put the-key --name script-name"))
217
+
.rejects.toThrowErrorMatchingInlineSnapshot(`
218
+
"Failed to automatically retrieve account IDs for the logged in user.
219
+
In a non-interactive environment, it is mandatory to specify an account ID, either by assigning its value to CLOUDFLARE_ACCOUNT_ID, or as \`account_id\` in your \`wrangler.toml\` file."
220
+
`);
225
221
});
226
222
227
223
it("should use the account from wrangler.toml",async()=>{
0 commit comments