question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importing polyfill directly does not work

See original GitHub issue

In latest 1.2.1 version:

Works:

import { polyfill } from 'seamless-scroll-polyfill';
...
polyfill();
window.scrollTo({
  top: 0,
});

Does not work:

import { windowScrollTo } from 'seamless-scroll-polyfill';
...
windowScrollTo({
  top: 0,
});

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
emilycrittercommented, Apr 22, 2021

I’m running into this issue in version 1.2.3 with importing elementScrollIntoView.

import { elementScrollIntoView } from 'seamless-scroll-polyfill';
...
elementScrollIntoView(el, { behavior: 'smooth' });
0reactions
magic-akaricommented, Sep 13, 2021

I’m running into this issue in version 1.2.3 with importing elementScrollIntoView.

import { elementScrollIntoView } from 'seamless-scroll-polyfill';
...
elementScrollIntoView(el, { behavior: 'smooth' });

same issue here, safari isnt working for elementScrollIntoView, im using latest version, pls help check

Hi, what’s the error message? By the way, the windowScroll API changed since 2.0. You should pass window as first argument.

There is no error message, just does not scroll at all, but chrome is working fine, im using latest version elementScrollIntoView should be using element right, why passing window as first argument?

Could you provide a code sandbox please? such as https://codesandbox.io/s/scrollintoview-iframe-zcwn0

May be i know the reason, because im using vite js + vue3, do you plan to support vite js in future? https://vitejs.dev/

I just tried Vite and Vue3 and everything seems to be OK.

The following is the simplest example. vite-project.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

Polyfill not applied on imported files - Stack Overflow
I've added a polyfill by importing '@babel/polyfill' at the top of my app's entry point (main. js), which works for most of my...
Read more >
How to load polyfills only when needed
I know three ready-to-use approaches for that: polyfill.io; the module / nomodule pattern; the useBuiltIns option in @babel/preset-env ...
Read more >
babel/polyfill
We do not recommend that you import the whole polyfill directly: either try the useBuiltIns options or import only the polyfills you need...
Read more >
Lazy loading polyfills with WebPack and dynamic imports
In such situations we need to import a library which would add a missing feature only when run in a browser not supporting...
Read more >
Shimming - webpack
This means writing isolated modules that are well contained and do not rely ... +import 'babel-polyfill'; + function component() { const element =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found