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

getHTML() is failing, not sure why. #401

Open
jisaacks opened this issue Feb 7, 2022 · 1 comment
Open

getHTML() is failing, not sure why. #401

jisaacks opened this issue Feb 7, 2022 · 1 comment

Comments

@jisaacks
Copy link

jisaacks commented Feb 7, 2022

I keep getting:

No style rules found on passed Component

I have been able to trace it to this line:

const getHTML = () => (isServer() ? new ServerStyleSheet().getStyleTags() : sheet.toString());

  const getHTML = () => (isServer() ? new ServerStyleSheet().getStyleTags() : sheet.toString());

My tests are running in node, so isServer is returning true, but new ServerStyleSheet().getStyleTags() is returning an empty string. However if I force it to instead use sheet.toString() everything works as expected and my tests pass/fail as expected.

@jisaacks
Copy link
Author

Any help on this?

If I manually edit that line to be:

const getHTML = () => (sheet.toString());

Everything works as expected.

I would hate to have to fork this project just to make that change tho.

Would love some help or pointed in the right direction to determine why isServer() is true but new ServerStyleSheet().getStyleTags() returns an empty string, even tho sheet.toString() works as expected.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant