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

TypeError: storyStore.getError is not a function (After installing @storybook/addon-storyshots) #9728

Closed
rimatla opened this issue Feb 3, 2020 · 2 comments

Comments

@rimatla
Copy link

rimatla commented Feb 3, 2020

Describe the bug
After installing @storybook/addon-storyshots: 5.3.10 or 6.0.0-alpha.4 storybook breakes in the browser and it errors: TypeError: storyStore.getError is not a function

We're in the process of upgrading to Storybook 5.3.10.
Without the Storyshots addon, everything builds correctly in the browser. 🎉

After following these instructions. Which docs states to require minimal set up if stories are wired to the main.js new syntax.

  • Installing a lower release of @storybook/addon-storyshots after running yarn test. Tests fail and I get the following error: Test suite failed to run: Cannot find module 'core-js/modules/es.array.for-each' from 'index.js'. But it does not prevent storybook to render without problems in the browser

  • Installing every addon (actions, storyshots, a11y) + storybook/react to be on the same version "5.3.10" or 5.3.9 after running yarn test. Tests passes and snapshots are created correctly. But storybook breaks and fails to render.

So the caveat here is that my stories seem to be wired correctly per the migration guide.
But the existence or absence of '@storybook/addon-storyshots' either gives me passing tests or stories rendering as CSF
but not both. 😿

To Reproduce
Steps to reproduce the behavior:

  1. Install react storybook and storyshots addon "5.3.10"

Expected behavior
Storybook should render correctly in the browser and snapshot add-on should read from Storyshots.test.js accordingly.

Screenshots
If applicable, add screenshots to help explain your problem.
Screen Shot 2020-02-03 at 1 49 14 PM

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

Foo.stories.js

import { action } from '@storybook/addon-actions'
import React from 'react'
// import * as React from "react"

import Foo from './Foo'

export default {
  title: 'Foo',
  component: Foo
}
export const foo = () => <p>Bar</p>

Storyshots.test.js

import initStoryshots from '@storybook/addon-storyshots'
initStoryshots()

package.json

**************
"peerDependencies": {
    "react": "16.x"
  },
  "devDependencies": {
    "@storybook/addon-a11y": "5.3.10",
    "@storybook/addon-actions": "5.3.10",
    "@storybook/addon-storyshots": "5.3.10",
    "@storybook/react": "5.3.10",
    "babel-core": "^6.26.0",
    "babel-jest": "^22.0.4",
    "babel-loader": "^7.x",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-plugin-transform-require-ignore": "^0.1.1",
    "babel-preset-env": "^1.6.1",
    "babel-preset-react": "^6.24.1",
***********

.storybook
main.js

module.exports = {
  stories: ['../src/**/*.stories.js'],
  addons: [
    '@storybook/addon-actions',
    '@storybook/addon-knobs',
    '@storybook/addon-a11y',
    '@storybook/addon-storyshots'
  ]
}

manager.js

import { addons } from '@storybook/addons'
import { create } from '@storybook/theming/create'

const theme = create({
  base: 'light',
  brandTitle: 'My Great Storybook'
})

addons.setConfig({
  theme
})

preview.js

import { addDecorator } from '@storybook/react'
import { withA11y } from '@storybook/addon-a11y'
import '../my.css

addDecorator(withA11y)

System:
Please paste the results of npx -p @storybook/cli@next sb info here.

Binaries:
  Node: 10.16.0 - /usr/local/bin/node
  Yarn: 1.16.0 - /usr/local/bin/yarn
  npm: 6.12.1 - /usr/local/bin/npm
Browsers:
  Chrome: 79.0.3945.130
  Firefox: 72.0.1
  Safari: 12.1.2
npmPackages:
  @storybook/addon-actions: 5.3.10 => 5.3.10
  @storybook/addon-storyshots: 6.0.0-alpha.4 => 5.3.10
  @storybook/react: 5.3.10 => 5.3.10

Additional context
I'm making sure that all packages related to storybook run on the same version.

@stale
Copy link

stale bot commented Feb 24, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Feb 24, 2020
@stale
Copy link

stale bot commented Mar 26, 2020

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Mar 26, 2020
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