-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dual package issue with Emotion 11.13 #3267
Comments
Is this the correct repro? It's the same one as the one you mention at the beginning of your issue and the last commit there was a year ago. I also rechecked that it's using Vite 4.3.9 - before my fix was merged and released. I patched it locally with my fix and confirmed that it resolves the issue in this repo. |
@Andarist I'm so sorry I linked the wrong reproduction repo !!! |
I think the issue here is that during SSR Vike picks up the non-development build because they just let node resolve modules (which is fine). I think they should configure the appropriate conditions for you automatically - that's something to be raised in Vike's issue tracker. Otherwise, they are creating an inconsistent environment when the server and the bundled files can use different sets of files. As a temporary workaround, you can start your dev server like this
|
Hello,
I previously reported a similar issue using this reproduction repo, which was resolved by @Andarist via a PR to Vite.
However, the issue has resurfaced with Emotion 11.13 with the introduction of the "development" resolution condition.
Let’s consider a module,
a-module-that-uses-emotion
, which imports@emotion/react
, and assume the app itself also imports@emotion/react
.In development mode, with Vike, during server-side rendering,
a-module-that-uses-emotion
imports@emotion/react
using theexports["."].default
condition, while the app’s direct import of@emotion/react
uses theexports["."].development.default
condition.To help reproduce the issue, I’ve prepared a repository:
https://github.com/garronej/vike-dual-package-repo-repo
Apologies for dropping such a complex issue on your plate, and thank you in advance for taking the time to review this.
Best regards,
REF: garronej/tss-react#218
The text was updated successfully, but these errors were encountered: