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

Why window instance is required on the server. #1291

Closed
ats1999 opened this issue Dec 8, 2020 · 4 comments
Closed

Why window instance is required on the server. #1291

ats1999 opened this issue Dec 8, 2020 · 4 comments

Comments

@ats1999
Copy link
Contributor

ats1999 commented Dec 8, 2020

related issue #1222

Window instance is required for this editor, this is not a big problem. But, why window instance is also required in the Viewer component. I am using NextJs with ReactJs, i need to render markdown content on the server. Because of this problem, i am not able to render markdown content on the server.

Although i can use dynamic provided by nextJs to render content on the client-side. But, we are not using a server-side rendering feature.

Possible solution

1 fix the existing code

2 Create another Viewer component named like ServerViewer which doesn'trequire window instance.

@seonim-ryu
Copy link
Member

@ats1999 I have a question. You said that accessing the window object is a problem when using Viewer. Can you tell me where to access the window object? It also tells you whether the problem is when you render or when you build.

@ats1999
Copy link
Contributor Author

ats1999 commented Dec 9, 2020

Can you tell me where to access the window object?

I know the server does not have any window object. So, we can't use the window on the server.

My question is Why window instance is required in the viewer component? I can guess, this editor might be using any function to convert markdown text into HTML content.

If I can get access to that function anyhow then also I can render content on the server.

Until a window object is required, I can not use the server-side rendering feature.

@stale
Copy link

stale bot commented Jan 8, 2021

This issue has been automatically marked as inactive because there hasn’t been much going on it lately. It is going to be closed after 7 days. Thanks!

@stale stale bot added the inactive label Jan 8, 2021
@stale
Copy link

stale bot commented Jan 16, 2021

This issue will be closed due to inactivity. Thanks for your contribution!

@stale stale bot closed this as completed Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants