jpuri / jpuri/draftjs-utils

Importing library on server side causes crash

Open
#30 10 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
286
Forks
46
PR merge metrics
No merged PRs in 30d

Description

When importing this library I get the error that the window is not defined as it is rendered on the server side.

In the js folder of this project the window is not used but when checking out the lib/draftjs-utils.js I see that there is a reference to the window. It would be nice if you could alter it so it doesn't crash on SSR 😢

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with lib/draftjs-utils.js and compare it with the js folder to trace the server-side import path and the window reference. Verify that importing the library during SSR no longer throws a window-not-defined error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.