Importing polyfill directly does not work
See original GitHub issueIn 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:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m running into this issue in version 1.2.3 with importing
elementScrollIntoView
.I just tried Vite and Vue3 and everything seems to be OK.
The following is the simplest example. vite-project.zip