html-next / vertical-collection

Infinite Scroll and Occlusion at > 60FPS
https://html-next.github.io/vertical-collection/
MIT License
176 stars 76 forks source link

Uncaught TypeError: Unable to get property 'source' of undefined or null reference #303

Closed frykten closed 2 years ago

frykten commented 5 years ago

Heya!

We've been trying to implement an addon using vertical-collection and on IE11, we found errors coming from vertical-collection TypeError: Unable to get property 'source' of undefined or null reference. We're not even really sure where it might be coming from unfortunately (we saw that issue #74 , which commit/possible-solution was trashed afterwards).

If we 'ember-cli-babel': { includePolyfill: true }, it works but we'd like to avoid such a rash solution and keep using only what we need to polyfill instead.

Would you know if there's a special polyfill we need to import or not? We tried with polyfill.io and not even importing everything worked... We tried to pinpoint what Babel could be doing that makes it run but the massload of lines is too noisy.

Thnx

pzuraq commented 5 years ago

So, unfortunately it's not really possible to only include the features that you use with Babel right now. This will become possible soon via Embroider/bundling, but that's not available just yet.

Luckily there's a solution that doesn't require you to ship the entire polyfill for every user: https://github.com/pzuraq/ember-cli-babel-polyfills. This addon only includes the polyfill in legacy browsers, such as IE11. This is arguably even better than only including the parts of the polyfill you actually use, because if you support IE11, you probably use most of it anyways. This way, only users on legacy platforms get dinged at all.

frykten commented 5 years ago

Hello!

Sorry if I've been unclear on our question. We've already looked at this addon you advise me to use and it's clearly an interesting one. Unfortunately we do not use Babel6 and therefore, for that and other reasons, are not inclined right now to use it even though we might in the future if needed.

What we are looking for is if you know what function(s)/object(s) (might) need a polyfill in vertical-collection so we might try to import/polyfill only this(ese) via https://polyfill.io/v3/url-builder/ , another service or ourselves.

Right now, we do not use most polyfills, barely ten, and we'd like to keep it this low a count :)

Thnx

pzuraq commented 5 years ago

ember-cli-babel-polyfills works with Babel 7. Are you using an earlier version of Babel?

Unfortunately, if we can't pinpoint where the bug is coming from, I'm not sure what we can do. This library shouldn't be relying on any features aren't supported in IE11, as you pointed out in #74 we did a lot of work to track down any potential issues in IE11 already and we tested it pretty thoroughly. It may be, like I said, that the issue is coming from some other part of the stack, such as Babel transpiling code in a way that is not compatible with IE11 (we noticed this when updating to Babel 7 in our codebase).

My recommendation here again is to include the full polyfill. You can do this in a way that only impacts IE11 users by using nomodule, which is what the addon I linked does.

mixonic commented 2 years ago

IE support ended with the 1.x series FYI (per #321). Do not expect maintainers to look into IE11 issues.