Code Monkey home page Code Monkey logo

Comments (8)

csandman avatar csandman commented on May 27, 2024 1

Hmm that is strange, that function is definitely available in @chakra-ui/react^2.0.0. It's possible something got messed up with lingering dependencies from an older version of chakra-react-select. Here's a couple options for what you could try (in the order I'd try them) to see if its a simple fix:

  1. Uninstall @chakra-ui/react and chakra-react-select completely then install them again one at a time in that order
  2. Wipe out your node_modules folder and try a fresh install
  3. Wipe out your node_modules and package-lock.json (or yarn.lock?) and try a fresh install

If none of those work I can take a deeper look into it. I see you have yarn listed under your engines field, is that what you're using? If so it might be a yarn thing, I've been having trouble getting the whole dependencies/peer dependencies thing working consistently on both npm and yarn. So if none of those work, and you are using yarn, let me know which version of it you're using.

from chakra-react-select.

csandman avatar csandman commented on May 27, 2024 1

Thanks @kafiln I think I've figured out what's causing issue but I'm still not sure specifically why it's happening. createStylesContext was not added in @chakra-ui/[email protected] as I thought, it was actually added in @chakra-ui/[email protected]. If I want to keep using it I should pin that peer dep to that version or above, which I'm not sure I want to do just yet as is could cause conflicts.

The part I'm confused about is why a version of @chakra-ui/system lower than v2.1.2 would be getting installed, especially if you're trying a fresh install after deleting the yarn.lock @benjamincharity. Unless the default behavior of yarn is just to install whatever the base version of a peer dep is, ignoring the ^ to allow for higher versions?

I actually just tried making a test app with yarn, installing all of the dependencies from scratch, and I'm not seeing this issue. Could you search your yarn.lock file for all instances of @chakra-ui/system and let me know if any of them are listed as lower than v2.1.2?


Regardless of your answer, I'm planning to revert back to the StylesProvider component and useStyles hook I was using in v4.1.2 for now, but it would be nice to have as many details as I can get to avoid introducing this issue in the future.

from chakra-react-select.

benjamincharity avatar benjamincharity commented on May 27, 2024 1

Sorry for the delay @csandman - I just added this package back to my Chakra v2 app and DO see older versions of chakra system in my lock file. Looking through our dependencies and tracked it down to this item:

"@snek-at/storybook-addon-chakra-ui": "^1.0.0",

This was forcing a 1.x install of chakra system. Once I removed that package, yarn.lock and node_modules and did a fresh install this package is working just fine 👍

Thanks again for looking into this!

from chakra-react-select.

benjamincharity avatar benjamincharity commented on May 27, 2024

Thanks for the quick response!

We are using Yarn v1.22.19

  1. I tried this after trying to remove the yarn.lock file and see the same results
  2. I have tried this a few times with no luck.
  3. I just not tried this and while I still get the error in the browser I also see the warning in console now:

image

And the browser error leads me here:

image

from chakra-react-select.

kafiln avatar kafiln commented on May 27, 2024

I'm having the exact same issue described above !
The issue seem to be present on version 4.1.3 but fortunately not on 4.1.2, so a quick workaround for me was to use version 4.1.2

from chakra-react-select.

csandman avatar csandman commented on May 27, 2024

Ok, I ended up fixing it by just removing the need for a styles context in the first place. The change has been published in v4.1.4.

Before upgrading to it @benjamincharity I'm still curious about my question in my last comment, whether or not you have any instances of @chakra-ui/system in your yarn.lock file. This would definitely help me troubleshoot issues like this in the future!

And If either of you are still having any issues after upgrading, feel free to re-open!

from chakra-react-select.

matthewrose avatar matthewrose commented on May 27, 2024

I saw this issue with createStylesContext as well. It seems odd that they would deprecate the original StylesProvider for this new approach, since the Chakra docs currently don't explain it or what it does.

from chakra-react-select.

csandman avatar csandman commented on May 27, 2024

@matthewrose it does seem odd, but my solution was just to stop using the old and new methods entirely just to not have to think about it.

The Chakra docs could definitely use some work though...

from chakra-react-select.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.