Vite bundled output includes react hooks #19354
Unanswered
samMcCarthyANDDigital
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
hoping for a simple resolution to an issue I've been having
We currently have vite running in lib mode as a design system with a number of components. This design system is imported to a nextjs 15 app using app router.
The issues we've come across are that as a few of these components need to implement react hooks the hooks are bundled into the outputted dist folder, When this is imported by a section in next we get an error about importing hooks this is then causing us to need to include use client at the top of every component that imports the design system even if the specific component being imported doesn't use a react hook
This is our current vite.config.js file:
our package.json:
and our first 2 lines from index.es.j:
Beta Was this translation helpful? Give feedback.
All reactions