# ESlint error when importing JS library

**URL:** https://discourse.roots.io/t/eslint-error-when-importing-js-library/11112
**Category:** sage
**Tags:** webpack
**Created:** 2017-12-11T10:00:45Z
**Posts:** 2
**Showing post:** 2 of 2

## Post 2 by @nadal — 2017-12-11T10:08:59Z

I was a bit too quick to ask for help. I found the solution here: [Sage 9 - external Js not defined](https://discourse.roots.io/t/sage-9-external-js-not-defined/9860/8)

So, my solution for anyone else who stumbles upon this page with the same error:

I moved imports and everything from main.js to routes/common.js, and now my common.js looks like this:

```
// import rellax.js
import Rellax from 'rellax/rellax.min';

export default {
  init() {
    // JavaScript to be fired on all pages
    var rellax = new Rellax('.rellax');
    rellax;
  },
  finalize() {
    // JavaScript to be fired on all pages, after page specific JS is fired
  },
};
```

---

_[View the full topic](https://discourse.roots.io/t/eslint-error-when-importing-js-library/11112)._
