gilgen / ember-pusher

A proper Ember / Pusher integration.
MIT License
100 stars 35 forks source link

Cannot read property 'wire' of undefined #23

Closed ChrisDrit closed 9 years ago

ChrisDrit commented 9 years ago

Hi, trying to figure out why I keep running into this error:

Cannot read property 'wire' of undefined

Basically, it's dying with 'ember-pusher.amd.js' line #17

target.pusher.wire(target, channelName, events);

When debugging it, there is no "pusher" object for the valid "target" object.

Thoughts?

Thanks!

Relevant info:

"ember-cli": "0.2.7" "ember-cli-pusher": "0.1.2" "ember": "1.13.0-beta.2" "ember-data": "1.0.0-beta.18" "ember-pusher": "ivanvotti/ember-pusher-component#master"


EDIT: A bit more info...

When extending this in the controller, it's never calling "ember-pusher.amd.js" line #256

Ember.Application.initializer({

And all of the objects (example "pusher") are not instantiated. I believe this is why the above mentioned pusher object does not exist on the "target" object:

target.pusher.wire(target, channelName, events);

As line #261, never being called, would instantiate it:

pusher = new Pusher(options.key, options.connection);

melindaweathers commented 9 years ago

I think the initialization you're looking for happens in the ember-cli-pusher addon in ember_cli_pusher/app/initializers/pusher.js.

I'm not sure what the problem is in your example, but maybe looking in the addon will help.

ChrisDrit commented 9 years ago

@melindaweathers thanks for pointing me in that direction! I see you had a similar issue here: https://github.com/ivanvotti/ember-cli-pusher/issues/5

Any chance you could let me know what you did to overcome your issue (as mine appears to be the same)?

melindaweathers commented 9 years ago

I don't remember what exactly the problem was. Here are some things I did in my commit where I converted to ember-cli-pusher:

That's really it. I think my import statements were incorrect at first. Wish I could remember!

ChrisDrit commented 9 years ago

Okay, issue solved, thanks @melindaweathers