Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not crash in wrangler dev if user has multiple accounts #1293

Merged
merged 11 commits into from
Jun 22, 2022

Conversation

petebacondarwin
Copy link
Contributor

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

@petebacondarwin petebacondarwin requested review from a team and threepointone as code owners June 18, 2022 11:25
@changeset-bot
Copy link

changeset-bot bot commented Jun 18, 2022

🦋 Changeset detected

Latest commit: 60fcf59

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jun 18, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2542396946/npm-package-wrangler-1293

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1293/npm-package-wrangler-1293

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2542396946/npm-package-wrangler-1293 dev path/to/script.js

@petebacondarwin petebacondarwin force-pushed the account-selector-dev branch 4 times, most recently from 2476264 to 2122d48 Compare June 18, 2022 17:51
@petebacondarwin petebacondarwin marked this pull request as draft June 19, 2022 06:00
@petebacondarwin petebacondarwin force-pushed the account-selector-dev branch 4 times, most recently from a04ed82 to 10255ea Compare June 20, 2022 13:37
@petebacondarwin petebacondarwin marked this pull request as ready for review June 20, 2022 13:43
@petebacondarwin petebacondarwin force-pushed the account-selector-dev branch 5 times, most recently from 205b5f6 to d5b5ba1 Compare June 22, 2022 11:58
The previous tests for non-interactive only checked the stdin.isTTY, but
you can have scenarios where the stdin is interactive but the stdout is not.
For example when writing the output of a `kv:key get` command to a file.

We now check that both stdin and stdout are interactive before trying to
interact with the user.
@petebacondarwin
Copy link
Contributor Author

OK - here goes!

@petebacondarwin petebacondarwin merged commit ee57d77 into cloudflare:main Jun 22, 2022
@github-actions github-actions bot mentioned this pull request Jun 22, 2022
@petebacondarwin petebacondarwin deleted the account-selector-dev branch June 23, 2022 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multiple accounts + dev = Silent Crash in dev mode
2 participants