willviles/ember-scrollmagic

Cannot read property 'addScene' of undefined

queenvictoria opened this issue · 2 comments

Hey there. Thanks a mil for the work. Any ideas about this error?

Uncaught TypeError: Cannot read property 'addScene' of undefined

My router has another scroll controller; removing it doesn't seem to fix it:

import EmberRouter from '@ember/routing/router';
import RouterScroll from 'ember-router-scroll';
import ScrollControllerRouteMixin from 'ember-scrollmagic/mixins/scroll-controllers/route-mixin';

import config from './config/environment';

const Router = EmberRouter.extend(RouterScroll, ScrollControllerRouteMixin, {
  location: config.locationType,
  rootURL: config.rootURL
});

My template has (copied from the docs):

    {{#scrollmagic-pinned duration="100%" offset="-50px"}}
    Pin me
    {{/scrollmagic-pinned}}

I've looked into this a bit more.

  1. Started with a vanilla 2.16.x $ ember init && ember install ember-scrollmagic && ember s
  2. Upgrade to 2.18.x
  3. Upgrade to 3.1.4

All of these scenarios resulted in the same uncaught type error.

Ok very sorry about that looks like I can't read documentation.

It needs to be registered in your routes/application.js:

I mixed it in to router.js like router-scroll rather than routes/application.js.

Closed.