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

Issue with deepEqual in SourceContainer #11413

Closed
azaxarov opened this issue Jul 3, 2020 · 2 comments
Closed

Issue with deepEqual in SourceContainer #11413

azaxarov opened this issue Jul 3, 2020 · 2 comments

Comments

@azaxarov
Copy link

azaxarov commented Jul 3, 2020

Describe the bug
My current Storybook setup works up to and including v6.0.0-beta.37. However, once Storybook dependencies are updated to v6.0.0-beta.38, the stories break on the deepEqual check in SourceContainer. The changes were introduced in #11332.

if (!deepEqual(sources, sourcesRef.current)) {

I suspect that it results in a false positive by checking equality of initial sources ({}) with sourcesRef.current that is undefined in my case. An additional check for undefined ref value seems reasonable:

if (sourcesRef.current && !deepEqual(sources, sourcesRef.current))

I appreciate the work you guys are doing and hope this is a relatively easy fix!

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Screen Shot 2020-07-03 at 21 17 18

Code snippets
If applicable, add code samples to help explain your problem.

System:

Environment Info:

  System:
    OS: macOS High Sierra 10.13.6
    CPU: (8) x64 Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz
  Binaries:
    Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
    npm: 6.14.5 - ~/.nvm/versions/node/v12.16.1/bin/npm
  Browsers:
    Chrome: 83.0.4103.116
    Firefox: 76.0.1
    Safari: 13.0.5
  npmPackages:
    @storybook/addon-a11y: ^6.0.0-beta.40 => 6.0.0-beta.40 
    @storybook/addon-essentials: ^6.0.0-beta.40 => 6.0.0-beta.40 
    @storybook/addon-links: ^6.0.0-beta.40 => 6.0.0-beta.40 
    @storybook/addons: ^6.0.0-beta.40 => 6.0.0-beta.40 
    @storybook/react: ^6.0.0-beta.40 => 6.0.0-beta.40 
    @storybook/theming: ^6.0.0-beta.40 => 6.0.0-beta.40

Additional context
Add any other context about the problem here.

@shilman
Copy link
Member

shilman commented Jul 4, 2020

Yo-ho-ho!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.41 containing PR #11414 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Jul 4, 2020
@azaxarov
Copy link
Author

azaxarov commented Jul 4, 2020

Great news! I'll give it a go today.

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

2 participants