# Sage 9 - external Js not defined

**URL:** https://discourse.roots.io/t/sage-9-external-js-not-defined/9860
**Category:** sage
**Tags:** sage9
**Created:** 2017-06-23T10:14:54Z
**Posts:** 27
**Showing post:** 8 of 27

## Post 8 by @Stephen — 2017-11-15T18:12:41Z

I took a slightly different (simpler?) route:

**Add via Yarn**

`yarn add barba.js --dev`

**routes/common.js**

```
import Barba from 'barba.js/dist/barba.min';

export default {
  init() {
    // JavaScript to be fired on all pages
    Barba.Pjax.start();
  },
  finalize() {
    // JavaScript to be fired on all pages, after page specific JS is fired

  },
};
```

That’s my whole `routes/common.js` file but you can see it’s just 2 lines added to it. Since I am importing/declaring then using `Barba` in the same place, there’s no need to disable the linting…

---

_[View the full topic](https://discourse.roots.io/t/sage-9-external-js-not-defined/9860)._
