Git Product home page Git Product logo

Comments (2)

thehypergraph avatar thehypergraph commented on June 12, 2024 2

I also have a problem, which I think is related here. I'm currently using Vite@^3.0.8 and Material UI 5 which relies on Popper. Lately every time I start the dev server I get the following error:

Uncaught TypeError: styled_default is not a function at Popper.js:9:20

If you look at the relevant file here is the signature of the object being exported:

const PopperUnstyled = React.forwardRef(function PopperUnstyled(props, ref) { ...

The ref is an object not a function which is why I believe it is failing here. Has this already been changed or what can be done to prevent this error? I can't use my dev env at all, but I can do a prod build no problem.

from vite-plugin-react.

ArnaudBarre avatar ArnaudBarre commented on June 12, 2024

Hi!
So yeah esbuild doesn't do this: evanw/esbuild#2749
As the main usage of Vite is for building application, this out of scope of esbuild and we won't move soon from esbuild, I have no other choices a closing this as won't fix.

Your workaround is fine for me and if build time is an issue, maybe there is a similar plugin for SWC.

Another solution is to manually write it in your library code.

from vite-plugin-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.