| #
065a44f7 |
| 04-Jul-2023 |
Cedric van Putten <[email protected]> |
fix(cli, dev-server): add `SYSTEMROOT` for `open` when opening browsers on Windows (#23287)
# Why
Fixes #23252
# How
- `open` has a bug on Windows, where it [uses
`process.env.SYSTEMROOT`]
fix(cli, dev-server): add `SYSTEMROOT` for `open` when opening browsers 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](https://github.com/sindresorhus/open/issues/300),
[#292](https://github.com/sindresorhus/open/issues/292),
[#270](https://github.com/sindresorhus/open/issues/270), or
[#205](https://github.com/sindresorhus/open/issues/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 <[email protected]>
show more ...
|