I've recently upgraded and it looks like emotion/r...
# support-questions-legacy
j
I've recently upgraded and it looks like emotion/react has been bundled into the library. This is causing issues because it's loaded globally twice
r
Hey! That's unexpected. We didn't really change anything to do with emotion in the recent versions. But we did change stuff to work with a later version of node / npm. Which version of the lib are you using?
perhaps @porcellus can help here
j
It might not be recent actually. But you can see the issue here
This could be maybe a vite bundling issue too
p
I don't think this issue is recent, but we aren't really bundling anything in our react lib. We are just depending on a version of emotion which may have gotten out of sync with the one your app needs.
I think this may cause this issue: your bundler may be trying to include both versions, which is the incorrect thing to do in this case.
j
I've only got a single version in my lockfile.. but yeah, I think @emotion/react needs to be a peer dependency
p
We want to drop the emotion dependency entirely - it causes a wide range of issues, but it seems to be a bit bigger task
hmm, so it's only installed once? that's weird.
then I'm not really sure why it's included multiple times... maybe some kind of code-splitting issue?
j
I think it might be vite's module bundling features
I'm not 100% why either
I actually just figured out my issue, was due to upgrading chakra and I was misusing one of the components. It was a context error so I assumed this was the issue
p
🙂 that's great.
j
I think just moving it to a peer dep would make the issue go away.
The warning that is
Appreciate the quick responses at any rate 🙂