-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 ignored --projectRoot/watchFolders arguments #21165
Conversation
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.
eslint
found some issues. You may run yarn prettier
or npm run prettier
to fix these.
local-cli/server/runServer.js
Outdated
@@ -58,6 +58,8 @@ async function runServer(args: Args, config: ConfigT) { | |||
config.server.port = args.port; | |||
config.reporter = reporter; | |||
config.resetCache = args.resetCache; | |||
config.projectRoot = args.projectRoot; | |||
config.watchFolders = args.watchFolders; |
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.
Cannot assign args.watchFolders
to config.watchFolders
because read-only array type [1] is incompatible with array type [2].
1bb2aef
to
20f4e87
Compare
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.
hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@oblador merged commit 9fca769 into Once this commit is added to a release, you will see the corresponding version tag below the description at 9fca769. If the commit has a single |
Summary: Due to Kureev's cleanup in c4a66a8 some arguments are no longer properly passed to metro, but just the default values. This broke the `--projectRoot` and `--watchFolders` arguments used by storybook to change the bundle entrypoint. This PR simply fixes the regression by assigning these values from argv instead of reading config defaults. Related: the undocumented `REACT_NATIVE_APP_ROOT` env var is broken, not sure for how long, but I can fix it as a part of this PR or make a new one. Pull Request resolved: #21165 Differential Revision: D9929642 Pulled By: hramos fbshipit-source-id: 00485a0429bd4301de03e5cb455e928878c4ba8f
Summary: Due to Kureev's cleanup in facebook/react-native@c4a66a8 some arguments are no longer properly passed to metro, but just the default values. This broke the `--projectRoot` and `--watchFolders` arguments used by storybook to change the bundle entrypoint. This PR simply fixes the regression by assigning these values from argv instead of reading config defaults. Related: the undocumented `REACT_NATIVE_APP_ROOT` env var is broken, not sure for how long, but I can fix it as a part of this PR or make a new one. Pull Request resolved: facebook/react-native#21165 Differential Revision: D9929642 Pulled By: hramos fbshipit-source-id: 00485a0429bd4301de03e5cb455e928878c4ba8f
Summary: Due to Kureev's cleanup in facebook@c4a66a8 some arguments are no longer properly passed to metro, but just the default values. This broke the `--projectRoot` and `--watchFolders` arguments used by storybook to change the bundle entrypoint. This PR simply fixes the regression by assigning these values from argv instead of reading config defaults. Related: the undocumented `REACT_NATIVE_APP_ROOT` env var is broken, not sure for how long, but I can fix it as a part of this PR or make a new one. Pull Request resolved: facebook#21165 Differential Revision: D9929642 Pulled By: hramos fbshipit-source-id: 00485a0429bd4301de03e5cb455e928878c4ba8f
Due to @Kureev's cleanup in c4a66a8 some arguments are no longer properly passed to metro, but just the default values. This broke the
--projectRoot
and--watchFolders
arguments used by storybook to change the bundle entrypoint.This PR simply fixes the regression by assigning these values from argv instead of reading config defaults.
Related: the undocumented
REACT_NATIVE_APP_ROOT
env var is broken, not sure for how long, but I can fix it as a part of this PR or make a new one.Test Plan:
I created a new folder called
newroot
with a differentindex.js
, started metro withreact-native start --projectRoot newroot
and got new content.Release Notes:
[CLI] [BUGFIX] [local-cli/server/runServer.js] - Fix --projectRoot/watchFolders arguments ignored