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

Using different port for the packager (instead of the default 8081). #1367

Closed
romshiri opened this issue Jun 27, 2017 · 3 comments
Closed

Using different port for the packager (instead of the default 8081). #1367

romshiri opened this issue Jun 27, 2017 · 3 comments

Comments

@romshiri
Copy link

It's not possible to run both React Native and Storybook packagers simultaneity as they both use port 8081 for running the packager.

I'd like to change the port Storybook packager runs on.
The command "npm run storybook -p " just change the port of the served HTML page.

@Gongreg
Copy link
Member

Gongreg commented Jun 28, 2017

Hey @romshiri,
Right now there is no way to do it.

But it can be quite easily implemented:

inside app/react-native/src/bin/storybook-start.js there are lines:

let cliCommand = 'node node_modules/react-native/local-cli/cli.js start';
if (program.haul) {
  cliCommand = `node node_modules/.bin/haul start --config ${program.haul} --platform all`;
}

We could add another command option for packager port.
If it was:

let cliCommand = 'node node_modules/react-native/local-cli/cli.js start --port=${YOUR PORT}';

It would work :).

If you want you could easily contribute on this thing. Or maybe I will have some free time tomorrow to do this.

@SaraChicaD
Copy link

SaraChicaD commented Jun 28, 2017

i'm having this same problem :'(

However in the slack Rafael Mendiola mentioned that:

The problem was that %appname% in storybook.js wasn't replaced properly with the application name. So after doing a fresh RN installation and running getstorybook, you end up with this line (if I remember correctly)
AppRegistry.registerComponent('%appname%', () => StorybookUI);

So I just replaced the app name and it worked.

@ndelangen
Copy link
Member

Sounds like something we could very easily do @Gongreg ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants