Skip to content
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

Chakra 2.x / React 18, styles missing #343

Open
cameronelliott opened this issue Jun 6, 2022 · 0 comments
Open

Chakra 2.x / React 18, styles missing #343

cameronelliott opened this issue Jun 6, 2022 · 0 comments
Labels
deno Not working in Deno

Comments

@cameronelliott
Copy link

Chakra 2.x doesn't correctly output styles for SSR on v85.

Because, this code is removed during compile:
https://github.com/emotion-js/emotion/blob/6f1f408217d84088cb1c63dc9d6bb8670a2ae78c/packages/styled/src/base.js#L34

Possible due to document being defined? I am not sure:
https://github.com/emotion-js/emotion/blob/6f1f408217d84088cb1c63dc9d6bb8670a2ae78c/packages/styled/src/base.js#L25

The compiled deno output is here:
https://esm.sh/v85/@emotion/styled@11.8.1/deno/styled.js?dev

The compiled node output is here:
https://esm.sh/v85/@emotion/styled@11.8.1/node/styled.js?dev

I was able to confirm the issue by using the 'node' output and hand-fixing the few 'process.env.NODE_ENV' checks.

Do you know why 'document' would be defined during the compile/serving of the Deno version of this file??? Or why that block of code would be removed during the compile phase??

(Thanks for creating esm.sh, I hope I can somehow help get Chakra 2.x + React 18.x working on esm.sh)

The original issue with more info is here:
emotion-js/emotion#2777

@cameronelliott cameronelliott added the deno Not working in Deno label Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deno Not working in Deno
Projects
None yet
Development

No branches or pull requests

1 participant