# Sage 9 + Infinite-scroll

**URL:** https://discourse.roots.io/t/sage-9-infinite-scroll/20499
**Category:** sage
**Tags:** eslint, webpack, sage9
**Created:** 2021-04-02T02:27:47Z
**Posts:** 3

## Post 1 by @hallowichig0 — 2021-04-02T02:27:48Z

Hi All,

I’m trying to import this [infinite-scroll.pkgd.js](https://infinite-scroll.com) in my main.js. When I run yarn build or yard start I’m getting errors like this:

Module parse failed: Unexpected token (464:19)  
You may need an appropriate loader to handle this file type.  
| this.element = element;  
| // options  
| this.options = { …InfiniteScroll.defaults };  
| this.option( options );  
| // add jQuery

@ ./resources/assets/scripts/main.js 10:0-51  
@ multi ./scripts/main.js ./styles/main.scss

Does anyone know how I can import this infinite-scroll with Sage 9?

Thank you!  
Jayson

---

## Post 2 by @strarsis — 2021-04-02T14:08:21Z

Can this help?

> [@Eslint - enable react?](https://discourse.roots.io/t/eslint-enable-react/19122/2):
>
> Maybe 'import/ignore': [ let the JSX parsing part ignore the files from node\_modules, hence the JavaScript parser still gets unprocessed JSX?

---

## Post 3 by @uzimike — 2021-04-20T04:21:11Z

I just ran into this too but I know I had this working on an older project.

Try `yarn add infinite-scroll@3.0.3`

This was the version of infinite-scroll I had before so I installed it on my current project and it worked! You might be able to find a newer version in between that works as well.

Edit: FYI the latest 3.0.X version is 3.0.6, works with yarn build too

---

## Post 4 by @system — 2021-05-14T02:38:04Z

This topic was automatically closed after 42 days. New replies are no longer allowed.
