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

SSR without document is breaking during initialising the module #52

Open
kiddkai opened this issue Oct 29, 2020 · 5 comments
Open

SSR without document is breaking during initialising the module #52

kiddkai opened this issue Oct 29, 2020 · 5 comments

Comments

@kiddkai
Copy link
Collaborator

kiddkai commented Oct 29, 2020

Hi,

I have been playing around with the latest router version, it seemed like when this router is running in Node.js environment without document supplied, it will try to access a global document:

https://github.com/atlassian-labs/react-resource-router/blob/master/src/common/constants.ts#L18

@rohan-deshpande
Copy link
Collaborator

rohan-deshpande commented Oct 29, 2020

I think JSDOM is currently still a hard requirement

@kiddkai
Copy link
Collaborator Author

kiddkai commented Oct 29, 2020

For router, I think it's better remove that dependency for server bundle, since it's not a hard requirement for router here.

@kiddkai
Copy link
Collaborator Author

kiddkai commented Oct 29, 2020

IMO, a separate browser field in the package.json to eliminate the browser host object dependency.

@kiddkai
Copy link
Collaborator Author

kiddkai commented Oct 29, 2020

@theKashey
Copy link
Collaborator

That's is the best way to distinguish node and browser 👍

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

3 participants