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

storybook RN server not refreshing stories #7017

Closed
edward-s opened this issue Jun 10, 2019 · 14 comments
Closed

storybook RN server not refreshing stories #7017

edward-s opened this issue Jun 10, 2019 · 14 comments

Comments

@edward-s
Copy link

edward-s commented Jun 10, 2019

Between 5.1.0-rc.4 and 5.1.3, Storybook RN server is no longer refreshing stories displayed on iOS simulator.

Steps to reproduce:

  1. Install @storybook/react-native-server": "5.1.3"
  2. Launch storybook RN server, navigate to localhost:7007 and click on any story
  3. iOS simulator shows Please open navigator and select a story to preview instead of displaying the selected story
  4. Open chrome console tab, the following error is shown:
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
    at sanitize (vendors~main.7825a50d99e16ac64ad5.bundle.js:21468)
    at Object.selectStory (vendors~main.7825a50d99e16ac64ad5.bundle.js:11623)
    at vendors~main.7825a50d99e16ac64ad5.bundle.js:9830
    at vendors~main.7825a50d99e16ac64ad5.bundle.js:14220
    at Array.forEach (<anonymous>)
    at Channel.handleEvent (vendors~main.7825a50d99e16ac64ad5.bundle.js:14219)
    at WebsocketTransport.handler (vendors~main.7825a50d99e16ac64ad5.bundle.js:14110)
    at WebSocket.socket.onmessage (vendors~main.7825a50d99e16ac64ad5.bundle.js:13986)

selected story loads correctly without the above error in @storybook/react-native-server": "5.1.0-rc.4", but fails with error in 5.1.0-rc.5 or 5.1.3

@edward-s
Copy link
Author

edward-s commented Jun 10, 2019

I did a small investigation and found that if I upgraded all to 5.1.3,

then manually restore back both @storybook/ui/dist/components/preview and @storybook/ui/dist/containers/preview from 5.1.0-rc.4, then the story is once again selectable via RN server. And no lowerCase of undefined error either

@JeffGuKang
Copy link
Contributor

JeffGuKang commented Jun 11, 2019

I have a same problem in @storybook/react-native-server": "5.1.3"

5.1.8 is also.

@SerhiyZheliznjak
Copy link

Have the same issue in @storybook/react-native-server": "5.1.7"
A workaround is to refresh chrome tab every time you choose new component

@fjtrujy
Copy link

fjtrujy commented Jun 18, 2019

We are exactly suffering the same issue, and for us is even worse, because we are using WebSockets to select the story in our Automation test to check the content is the proper one.

Thanks

@alechp
Copy link

alechp commented Jun 26, 2019

@edward-s Does this screencast reflect the issue you're describing?

https://drive.google.com/open?id=1KrkFttWi__MM8C2ms3hXIr1C3YYR1VdJ

@JeffGuKang
Copy link
Contributor

@edward-s Does this screencast reflect the issue you're describing?

https://drive.google.com/open?id=1KrkFttWi__MM8C2ms3hXIr1C3YYR1VdJ

Exactly same.

@westenjones
Copy link

westenjones commented Jun 27, 2019

@edward-s Does this screencast reflect the issue you're describing?

https://drive.google.com/open?id=1KrkFttWi__MM8C2ms3hXIr1C3YYR1VdJ

Also reflects what I am experiencing at 5.1.9. Also getting the toLowerCase error in the console.

edit: Refreshing in the browser after selecting a story functions successfully as a workaround here too.

@alechp
Copy link

alechp commented Jun 27, 2019

@shilman I put together a fresh expo/storybook repo to illustrate.

  • Repo

https://github.com/servexyz/rnes5-v2

  • Screenshots & package info of step-by-step reproduction:

RNES5-v2.pdf

  • Screencast illustrating issue

https://drive.google.com/open?id=1KrkFttWi__MM8C2ms3hXIr1C3YYR1VdJ

@Gongreg
Copy link
Member

Gongreg commented Jul 1, 2019

Hey, I think this issue is related to #4716. It already has a fix and should be released soon.

@Gongreg
Copy link
Member

Gongreg commented Jul 3, 2019

Hey,
the fix is released in v5.2.0-alpha.35

@Gongreg Gongreg closed this as completed Jul 3, 2019
@alechp
Copy link

alechp commented Jul 3, 2019

Confirmed it's working.

For anyone wanting to save a few minutes on upgrading before testing, here's a sample repo upgraded to 35a:

https://github.com/servexyz/rnes5-v2

Screen Shot 2019-07-03 at 11 10 31 AM

@JeffGuKang
Copy link
Contributor

It works well with

    "@storybook/react-native": "5.2.0-alpha.36",
    "@storybook/react-native-server": "5.2.0-alpha.36",

@lapongua
Copy link

It works well with

    "@storybook/react-native": "5.2.0-alpha.36",
    "@storybook/react-native-server": "5.2.0-alpha.36",

I have updated to this version and now the stories are not loading.

@JeffGuKang
Copy link
Contributor

Did you try to start storybook with --reset-cache ?
And refresh your simulator or device that is started with storybook?

It works well with

    "@storybook/react-native": "5.2.0-alpha.36",
    "@storybook/react-native-server": "5.2.0-alpha.36",

I have updated to this version and now the stories are not loading.

chico added a commit to codeandrobots/codeandrobots-app that referenced this issue Oct 4, 2019
Changes:
 - Update storybook version to fix refresh issue, see
   storybookjs/storybook#7017
 - Update storybook script to include react-native start
 - Mock out STORYBOOK_HOOKS_CONTEXT
 - Update storybook section in README
chico added a commit to OttoDIY/OttoDIYApp that referenced this issue Oct 4, 2019
Changes:
 - Update storybook version to fix refresh issue, see
   storybookjs/storybook#7017
 - Update storybook script to include react-native start
 - Mock out STORYBOOK_HOOKS_CONTEXT
 - Update storybook section in README
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

9 participants