-
-
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
Emotion with Deno is Okay, Chakra with Deno results in no style output #2777
Comments
Well, it is somewhat weird because I would expect that if there is a problem then Emotion shouldn't work with Deno on its own either. I know what I would check on your place but I have no experience with Deno and I don't know how to quickly debug it so I think that you are a better person to check those things. I've checked that in theory that your Chakra requests the very same I would still try to confirm if that's really the case throughout the app - is there a way to see all of the files included in this compilation? |
As far as I can tell, it is the same:
|
But, if I use a different method to report all emotion related packages, I see this:
Which does have two versions for 'memoize', and 'is-prop-valid', |
No, those can be freely duplicated - it shouldn't matter. As far as I can tell by looking at the minified emotion/packages/styled/src/base.js Line 34 in 6f1f408
It means that the esm.sh service has bundled our code for the browser target and not for the server (it probably has this logic as its default). We can read on their page that they allow customizing the target:
BUT I can't see any way to set the target env as server/node/deno Given that... I have no idea why the non-Chakra versions works because I would have expect for the same thing to happen. |
Actually, I've found in their source code that I've also confirmed that this works: |
@Andarist Hey, your help was fantastic. Thank you! I really hope we can get Chakra+Emotion working with Deno correctly using I took the node version, hand-fixed a few Node calls, and swapped it in using Deno import maps, and Do you know why window.document might be defined during esm.sh compilation I am trying to nail this down in order to provide a PR/fix. Oh! one other thing, in the emotion-only, non-Chakra case, |
This is the command esm.sh uses to build it's modules node /usr/bin/yarn add --check-files --ignore-engines --ignore-platform --ignore-scripts --ignore-workspace-root-check --no-bin-links --no-default-rc --no-lockfile --no-node-version-check --no-progress --non-interactive --silent --registry=https://registry.npmjs.org/ @emotion/styled
warning "@emotion/styled > @emotion/babel-plugin@11.9.2" has unmet peer dependency "@babel/core@^7.0.0".
warning "@emotion/styled > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.17.12" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > @emotion/styled@11.8.1" has unmet peer dependency "@emotion/react@^11.0.0-rc.0".
warning Ignored scripts due to flag. Well, this can very based upon targets, but I'm working it. |
Doesn't this
Hm, did you have to hand-fix anything in Emotion to make it work? I don't think we are using anything node-specific - I could be wrong though.
It's not exactly that emotion/packages/styled/package.json Lines 53 to 56 in 6f1f408
|
I believe that the issue has been answered and there isn't anything that we can do to improve the situation further on our side. |
I get the following valid with styles output:
emotion html <style data-emotion="css 3h4kzc">.css-3h4kzc{color:hotpink;}</style><div class="css-3h4kzc">Some hotpink text.</div>
when I run:
deno run -A --no-check emotion.jsx
on this:
BUT, when I run:
deno run -A --no-check chakra.jsx
, on the code near the end of the issue...... I get the following HTML which is missing the styles in front of the Chakra HTML output:
**If an emotion dev sees the obvious problem, I would be grateful for any suggestions or help. **
Sorry to ask here, but I suspect you are better informed about the possibilities than Chakra or Deno persons
Deno Emotion/Chakra code
The text was updated successfully, but these errors were encountered: