Storybook: Storybook 4/Addon Dependencies breaks mobx/mobx-react @observable

Created on 3 Dec 2018  路  4Comments  路  Source: storybookjs/storybook

Describe the bug

_I couldn't determine if this should be filed as a Storybook bug or as a Feature request for support with MobX/Mobx-react._

https://stackoverflow.com/questions/53547412/storybook-breaks-mobx-mobx-react

With most recent versions of React/MobX/mobx-react @observable variables are defined,
after running npm i --save-dev @storybook/react @storybook/addon-notes @storybook/addon-links @storybook/addon-actions @storybook/addon-knobs all of those @observable variables become undefined leading to a failure to compile.

To Reproduce

_Steps to reproduce the behavior:_

  1. CRA and eject or use react-rewired
  2. Insure you have the newest versions of React/MobX/MobX-React dependencies
  3. Create some variables under mobx @observable, ensure that babel plugins in package.json has "transform-decorators-legacy".
  4. Run npm run start to see the variables working as defined pre installation of storybook
  5. Install storybook using CLI and see that variables are undefined and the app fails to compile.
  6. while storybook and addon dependencies installed, run npm run storybook script to see that Storybook works fine, it's the standard app that fails to compile.
  7. run npm uninstall --save-dev @storybook/react @storybook/addon-notes @storybook/addon-links @storybook/addon-actions @storybook/addon-knobs to see that npm run start to run the application works again.

Expected behavior

Install storybook CLI and both npm run start and npm run storybook to work simultaneously without failure to compile do to undefs.

System:

  • OS: [MacOS Mojave 10.14.1]
  • Device: [MacBook Pro (15-inch, 2018)]
  • Browser: [Chrome, Firefox, Safari]
  • Framework: [React]
  • Addons: [MobX, MobX-React]

Versions:

"react": "^16.6.3",
"react-dom": "^16.6.3",
"mobx": "^5.6.0",
"mobx-react": "^5.4.2"

"devDependencies": {
    "@storybook/addon-actions": "^4.0.9",
    "@storybook/addon-knobs": "^4.0.9",
    "@storybook/addon-links": "^4.0.9",
    "@storybook/addon-notes": "^4.0.8",
    "@storybook/react": "^4.0.9"
  }
compatibility with other tools inactive question / support

Most helpful comment

@igor-dv It would be my pleasure, I'll set one up after work. This error actually occurred trying to implement Storybook. Hopefully a resolution will be figured out. I can't imagine that other MobX stacks don't use Storybook 4...

All 4 comments

We should probably setup a CLI test for this...
Anyway, can you create a reproduction repo?

@igor-dv It would be my pleasure, I'll set one up after work. This error actually occurred trying to implement Storybook. Hopefully a resolution will be figured out. I can't imagine that other MobX stacks don't use Storybook 4...

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!

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!

Was this page helpful?
0 / 5 - 0 ratings