Skip to content

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