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

Uncaught TypeError: context.stylis is not a function #6093

Closed
bernatfortet opened this issue Mar 14, 2019 · 10 comments
Closed

Uncaught TypeError: context.stylis is not a function #6093

bernatfortet opened this issue Mar 14, 2019 · 10 comments

Comments

@bernatfortet
Copy link

Describe the bug
Storybook build but in the window (localhost:6006) I get the following console error:
Uncaught TypeError: context.stylis is not a function

image

System:

  • OS: MacOS (High Sierra)
  • Device: MacBook Pro mid 105
  • Browser: chrome
  • Framework: react
  • Addons: [if relevant]
  • Version: 5.0.1
@shilman
Copy link
Member

shilman commented Mar 15, 2019

Looks like you need to wrap your stories with some provider that adds stylis to the context in config.js, e.g.

addDecorator(storyFn => <SomeProvider>{storyFn()}</SomeProvider>)

But I don't know enough about stylis or your project to know what that provider would be

@shilman shilman added this to the 5.0.x milestone Mar 15, 2019
@Armanio
Copy link
Member

Armanio commented Mar 17, 2019

Could you share code snippet for reproduce this?

@stale
Copy link

stale bot commented Apr 7, 2019

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 Apr 7, 2019
@Jack-Works
Copy link

Jack-Works commented Apr 24, 2019

Also have this problem and I'm not using stylis

@stale stale bot removed the inactive label Apr 24, 2019
@njarin
Copy link

njarin commented Apr 25, 2019

I also had this problem on a storybook project. I deleted the contents of the .cache folder in the repo and restarted my storybook server. The error is gone. Not sure what caused the issue to manifest in the first place though.

@RickyMarou
Copy link

RickyMarou commented May 1, 2019

Clearing node_modules fixed the problem for me. Deleting only the .cache folder was not enough 🤷‍♂️

@shilman shilman added the yarn / npm Yarn / npm acting weird label May 2, 2019
@bernatfortet
Copy link
Author

@Armanio, sorry for the late response. I think I did the same @RickyMarou and it fixed my issue.
Hard to create a snippet for that.

@stale
Copy link

stale bot commented May 29, 2019

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 May 29, 2019
@shilman shilman modified the milestones: 5.0.x, 5.1.x Jun 5, 2019
@stale stale bot removed the inactive label Jun 5, 2019
@tsaiDavid
Copy link

I actually got this same issue when upgrading from v4 -> v5. I'm using Lerna + Yarn Workspaces and just had to delete all node_modules/ and was good to go

@Jack-Works
Copy link

remove node_modules solve my problem

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

8 participants