Skip to content

Module don't work along with webpack #25

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

Open
xiaoyuze88 opened this issue Aug 11, 2016 · 1 comment
Open

Module don't work along with webpack #25

xiaoyuze88 opened this issue Aug 11, 2016 · 1 comment

Comments

@xiaoyuze88
Copy link

Because after processed by webpack, 'this' that passed to the factory function won't point to the global window, but an empty object {}, which makes window.document is undefined.

So when executing this line:
'onfocusin' in document, this error throws: Uncaught TypeError: Cannot use 'in' operator to search for 'onfocusin' in undefined.

Just change this to window can fix this (In NodeJS, this module won't work anyway, so it doesn't matter to pass window directly)

@xiaoyuze88
Copy link
Author

xiaoyuze88 commented Aug 11, 2016

This issue seems have already been fixed at v1.0.12, but v1.0.12 is not published to the npm, maybe this should be updated on npm, thanks a lot!

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

1 participant