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

Added document object as fallback #86

Closed
wants to merge 1 commit into from
Closed

Added document object as fallback #86

wants to merge 1 commit into from

Conversation

jeff-ong
Copy link

@jeff-ong jeff-ong commented Oct 14, 2019

Signed-off-by: Jeff Ong [email protected]

#49

Problem
Since the library relies on a global window object, bundling it as a Node module in CommonJS context will cause the following problem:

Uncaught TypeError: Cannot read property 'PointerEvent' of undefined

Solution
Added validation and fallback whenever the window object is used in the library.

desandro added a commit that referenced this pull request Oct 23, 2019
Addresses `this = window` mismatch with Webpack, Parcel, Gatsby.
@desandro
Copy link
Member

Thank you for this contribution! I have added this code and some more in SHA: 3566dcb. This fix has been released in v1.1.1.

@desandro desandro closed this Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants