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

Error thrown when attempting to use Material UI StylesProvider #8561

Closed
colebillys19 opened this issue Oct 24, 2019 · 1 comment
Closed

Error thrown when attempting to use Material UI StylesProvider #8561

colebillys19 opened this issue Oct 24, 2019 · 1 comment

Comments

@colebillys19
Copy link

colebillys19 commented Oct 24, 2019

Repo: https://github.com/colebillys19/simple-storybook
By default, Material UI styles get applied after all other styles. In order to inject them first, their docs instruct to wrap your component tree in a StylesProvider and pass it the injectFirst prop. After doing this and starting up the storybook I get the following error:

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `storyFn`.
    at http://localhost:9009/vendors~main.dde01deb994fa36497d0.bundle.js:130394:34
    at createFiberFromTypeAndProps (http://localhost:9009/vendors~main.dde01deb994fa36497d0.bundle.js:130397:13)
    at createFiberFromElement (http://localhost:9009/vendors~main.dde01deb994fa36497d0.bundle.js:130418:15)
    at reconcileSingleElement (http://localhost:9009/vendors~main.dde01deb994fa36497d0.bundle.js:120888:23)
    at reconcileChildFibers (http://localhost:9009/vendors~main.dde01deb994fa36497d0.bundle.js:120945:35)
    at reconcileChildren (http://localhost:9009/vendors~main.dde01deb994fa36497d0.bundle.js:123049:28)
    at mountIndeterminateComponent (http://localhost:9009/vendors~main.dde01deb994fa36497d0.bundle.js:123756:5)
    at beginWork$1 (http://localhost:9009/vendors~main.dde01deb994fa36497d0.bundle.js:124844:16)
    at HTMLUnknownElement.callCallback (http://localhost:9009/vendors~main.dde01deb994fa36497d0.bundle.js:106705:14)
    at Object.invokeGuardedCallbackDev (http://localhost:9009/vendors~main.dde01deb994fa36497d0.bundle.js:106755:16)

Take a look at .storybook/config.js - I have working code (that doesn't include StylesProvider) included.

Expected behavior
No error should be thrown.

Screenshots
Screen Shot 2019-10-24 at 1 19 50 PM
Screen Shot 2019-10-24 at 1 13 09 PM

System:

Environment Info:

  System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  Binaries:
    Node: 12.12.0 - /usr/local/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.11.3 - /usr/local/bin/npm
  Browsers:
    Chrome: 78.0.3904.70
    Safari: 12.1.2
  npmPackages:
    @storybook/addon-a11y: 5.2.1 => 5.2.1 
    @storybook/addon-actions: 5.2.1 => 5.2.1 
    @storybook/addon-backgrounds: 5.2.3 => 5.2.3 
    @storybook/addon-docs: 5.2.4 => 5.2.4 
    @storybook/addon-knobs: 5.2.1 => 5.2.1 
    @storybook/addon-storyshots: 5.2.3 => 5.2.3 
    @storybook/addon-storysource: 5.2.1 => 5.2.1 
    @storybook/addons: 5.2.1 => 5.2.1 
    @storybook/react: 5.2.1 => 5.2.1 
    @storybook/source-loader: 5.2.4 => 5.2.4 
@shilman
Copy link
Member

shilman commented Oct 25, 2019

@colebillys19 I'm not seeing any error when I download & run the repo?

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