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

fix: unsafe read from document in server-side rendering #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

louh
Copy link

@louh louh commented Dec 22, 2020

Currently, this module fails in SSR because it reads from the document global variable when it is evaluated at compile time. This fix moves reading the document variable from the top level of the module, into the body of the activityDetector function, whose contents are not evaluated when bundling. This allows the module to work as-is in apps that do SSR.

See this issue: #10

Currently, this module fails in SSR because it reads from the `document` global variable when it is evaluated at compile time. This fix moves reading the `document` variable from the top level of the module, into the body of the `activityDetector` function, whose contents are not evaluated when bundling. This allows the module to work as-is in apps that do SSR.

See this issue: tuenti#10
@axe312ger
Copy link

Please merge this. Would help so much! @tuenti

@axe312ger
Copy link

I published this pr as activity-detector-ssr

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