Skip to content

TypeError: Cannot read property 'lookup' of undefined #81

@psbanka

Description

@psbanka

I believe this is related to a regression in Ember 2.13.0-beta, but I thought I'd file an issue in order to track it. We are getting an error in href-to here: https://github.com/intercom/ember-href-to/blob/master/addon/helpers/href-to.js#L6 when testing:

const $result = Ember.$(`<div>${helper.compute([ event ])}</div>`);
assert.equal($result.text(), 'Version 511 was activated', 'full text');

Where our helper simply calls hrefTo:

hrefTo('configure.service.version', version)

The fix to this was to change the aforementioned like 6 in href-to.js to:

const container = getOwner(context) || context.container;
let router = container.lookup('router:main');

which was recommended in a similar issue in the torii project, here: https://github.com/Vestorly/torii/issues/349#issuecomment-302141236

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions