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

issue when expose arrive API to window #60

Open
giannoudak opened this issue Jun 6, 2017 · 6 comments
Open

issue when expose arrive API to window #60

giannoudak opened this issue Jun 6, 2017 · 6 comments

Comments

@giannoudak
Copy link

hi, and thanks for your wrapper library over Mutation Observers
we use arrive.js in one site, and when trying to expose the arrive API in window, we get the error bellow:

// the call in arrive.js line 441:
exposeApi(window.prototype);

// the error:
Uncaught TypeError: Cannot set property 'arrive' of undefined
    at Object.exposeApi (arrive.js:427)
    at eval (eval at <anonymous> (arrive.js:440), <anonymous>:1:1)
    at arrive.js:440
    at Object.r.1 (arrive.js:449)

it seems that the window.prototype is undefined. why this may happen? Is there any way to override this property of window object?

is there any workaround on this? maybe using Window.proto instead will fix it?

@uzairfarooq
Copy link
Owner

@giannoudak is it specific to some browser. If so, let me know the browser name & version. Also, is your site live, can I check it?

@giannoudak
Copy link
Author

@uzairfarooq It isn't for a specific browser. I tried both in chrome and Firefox and the problem is same.
You could check this issue at the homepage of the site below.
http://www.happyparenting.gr/
Let me know your thoughts.

@giannoudak
Copy link
Author

hi @uzairfarooq did you manage to check fo this?
thanks in adavance

@uzairfarooq
Copy link
Owner

Yeah, I had a look into it but not sure what's causing window.prototype to be null, could be some other library. As a workaround you can remove exposeApi(Window.prototype); from the lib.

Will try to have a detailed look when I have some time.

@cryptish
Copy link

Window is not defined in PhantomJS (prebuilt, 2.1.14) (running under Karma (0.13.22)).

@uzairfarooq
Copy link
Owner

We should consider using globalThis (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis) in arrive with appropriate fallbacks.

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