Giter Site home page Giter Site logo

Comments (8)

garronej avatar garronej commented on August 20, 2024

image

from tss-react.

garronej avatar garronej commented on August 20, 2024

I ran into this error many times myself working with onyxia-ui in onyxai-web.

If you do yarn link in your UI module and yarn link <your ui moduel> you get this error at runtime.

You also need to:

cd <your ui library>/node_modules/react
yarn link
cd <your ui library>/node_modules/@types/react
yarn link

cd <your main app>
yarn link react @types/react

from tss-react.

garronej avatar garronej commented on August 20, 2024

We use a script to automate that if you are interested.

from tss-react.

 avatar commented on August 20, 2024

I ran into this error many times myself working with onyxia-ui in onyxai-web.

If you do yarn link in your UI module and yarn link <your ui moduel> you get this error at runtime.

You also need to:

cd <your ui library>/node_modules/react
yarn link
cd <your ui library>/node_modules/@types/react
yarn link

cd <your main app>
yarn link react @types/react

Thanks for your quick reply buddy :)

Not sure whether we were talking about the same issue.

My issue is that our library is packed and published on NPM, and we use this wrapped package within our main project by installing the package through npm.

The "makeStyles", "createStyles" created within the library could not work in our main repo, as well as all the customized components. :)

Sorry for all these questions haha...

from tss-react.

 avatar commented on August 20, 2024

Is there any easy way to make it working? Because most of the packages don't need to use link :)
We upgraded from V4 and V4 doesn't need link to achieve this.

from tss-react.

garronej avatar garronej commented on August 20, 2024

This should be an easy fix yes. Can I see the NPM package of your UI lib?
Maybe you have "react" in dependencies instead of "peerDependencies"?

from tss-react.

 avatar commented on August 20, 2024

This should be an easy fix yes. Can I see the NPM package of your UI lib? Maybe you have "react" in dependencies instead of "peerDependencies"?

You are right brother, some stupids removed these lines secretly. Now working like a charm... Tons of thanks for your solution on yarn link and I will use it on local development. Really helpful and thanks for your great work!!!!!!

This is an amazing library, really well built!

from tss-react.

garronej avatar garronej commented on August 20, 2024

Thank you for the kind words, much appreciated!

If you use our script, unless you are using TS_CI, you will need to remove theses lines.

Also you'll have to edit this line and put your own libraries that you need to link.

And of course don't forget to add .yarn_home to your .gitignore.

Best

from tss-react.

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.