-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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(cli, dev-server): add SYSTEMROOT
for open
when opening browsers on Windows
#23287
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
expo-bot
added
bot: passed checks
ExpoBot has nothing to complain about
and removed
bot: suggestions
ExpoBot has some suggestions
labels
Jul 4, 2023
Preferably, we should switch to a proper working library 🙈 |
brentvatne
approved these changes
Jul 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥵
cc @Kudo - just so you're aware, since you had some overlap with this when launching chrome inspector |
EvanBacon
approved these changes
Jul 4, 2023
byCedric
added a commit
that referenced
this pull request
Jul 4, 2023
…rs on Windows (#23287) # Why Fixes #23252 # How - `open` has a bug on Windows, where it [uses `process.env.SYSTEMROOT`](https://github.com/sindresorhus/open/blob/main/index.js#L173) instead of [`process.env.SystemRoot`](https://en.wikipedia.org/wiki/Environment_variable#:~:text=The%20%25SystemRoot%25%20variable%20is%20a,including%20the%20drive%20and%20path.) - This causes the executed command to run with `undefined\\...` - There has been no fix yet, and due to `open` being fully ESM now, we probably can't upgrade too > See various issues [#300](sindresorhus/open#300), [#292](sindresorhus/open#292), [#270](sindresorhus/open#270), or [#205](sindresorhus/open#205) This basically sets the missing `SYSTEMROOT` when trying to open a browser on Windows. It's fixed in both `@expo/cli` as well as `@expo/dev-server` (to open the Chrome DevTools). # Test Plan This has to be tested on Windows. - `$ yarn create expo ./test-browser -t tabs@beta` - `$ cd ./test-browser` - `$ yarn start` - Try pressing the following keys: - `j` -> to open the Chrome DevTools, after connecting a device. Should work as expected. - `w` -> to open the browser with Metro web. Should work as expected. # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
This was referenced Jul 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bot: passed checks
ExpoBot has nothing to complain about
published
Changes from the PR have been published to npm
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Fixes #23252
How
open
has a bug on Windows, where it usesprocess.env.SYSTEMROOT
instead ofprocess.env.SystemRoot
undefined\\...
open
being fully ESM now, we probably can't upgrade tooThis basically sets the missing
SYSTEMROOT
when trying to open a browser on Windows. It's fixed in both@expo/cli
as well as@expo/dev-server
(to open the Chrome DevTools).Test Plan
This has to be tested on Windows.
$ yarn create expo ./test-browser -t tabs@beta
$ cd ./test-browser
$ yarn start
j
-> to open the Chrome DevTools, after connecting a device. Should work as expected.w
-> to open the browser with Metro web. Should work as expected.Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).