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

Modify css support check to work better with SSR #92

Merged
merged 1 commit into from
May 5, 2019

Conversation

johnnyeric
Copy link
Contributor

Hi @kazzkiq. Thanks for this project, it's great!

I've been experimenting the editor with Next.js and found an issue when using SSR on the CSS check.

It's a very simple fix but I took the liberty of creating this pull request.

Thank you

@kazzkiq
Copy link
Owner

kazzkiq commented May 5, 2019

Hello @johnnyeric, glad you liked CodeFlask!

Care to elaborate a little more about the issue with Next.js?

Shouldn't CSS be undefined both in client and SSR if it doesn't exists? In this case, the if(CSS) should handle both cases, why isn't it the case for Next.js?

@johnnyeric johnnyeric force-pushed the fix_modify-css-check-for-ssr branch from 245c8d3 to 82a213d Compare May 5, 2019 04:08
@johnnyeric
Copy link
Contributor Author

Sure, the problem is that when rendering on the server it seems the variable is not even declared so it throws when trying to access it in the if(CSS).

Then the typeof handles both cases, when it is not declared and when it is declared but is undefined.

The error message I get is CSS is not defined.

@kazzkiq
Copy link
Owner

kazzkiq commented May 5, 2019

Now it makes sense, merging it.

Thanks for the PR!

@kazzkiq kazzkiq merged commit 62a6f88 into kazzkiq:master May 5, 2019
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

Successfully merging this pull request may close these issues.

2 participants