willviles / ember-scrollmagic

An Ember addon for building magical scroll interactions using ScrollMagic.js
https://willviles.github.io/ember-scrollmagic
MIT License
18 stars 4 forks source link

Cannot read property 'addScene' of undefined #14

Closed queenvictoria closed 6 years ago

queenvictoria commented 6 years ago

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}}
queenvictoria commented 6 years ago

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.

queenvictoria commented 6 years ago

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.