Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link-to in integration tests throw: Cannot read property 'applyIntent' of undefined #15831

Closed
rwjblue opened this issue Nov 8, 2017 · 5 comments

Comments

@rwjblue
Copy link
Member

rwjblue commented Nov 8, 2017

The following error occurs on canary (but works properly on prior releases) for this test:

not ok 47 Chrome 62.0 - component:o it can render a link-to
    ---
        actual: >
            false
        expected: >
            true
        stack: >
            Error: Assertion Failed: You attempted to define a `{{link-to "index"}}` but did not pass the parameters required for generating its dynamic segments. Cannot read property 'applyIntent' of undefined
                at new EmberError (http://localhost:7357/assets/vendor.js:13925:25)
                at assert (http://localhost:7357/assets/vendor.js:14168:15)
                at Class.computeLinkToComponentHref (http://localhost:7357/assets/vendor.js:17044:65)
                at ComputedPropertyPrototype.get (http://localhost:7357/assets/vendor.js:25789:28)
                at get (http://localhost:7357/assets/vendor.js:25131:20)
                at RootPropertyReference.compute (http://localhost:7357/assets/vendor.js:21709:40)
                at RootPropertyReference.value (http://localhost:7357/assets/vendor.js:21590:53)
                at ReferenceCache.initialize (http://localhost:7357/assets/vendor.js:924:52)
                at ReferenceCache.peek (http://localhost:7357/assets/vendor.js:898:29)
                at DynamicAttribute.flush (http://localhost:7357/assets/vendor.js:2776:37)
        message: >
            Assertion Failed: You attempted to define a `{{link-to "index"}}` but did not pass the parameters required for generating its dynamic segments. Cannot read property 'applyIntent' of undefined

The test is attempting to ensure that a component integration test is capable of rendering a {{link-to}} even when the router is not booted/available.

Demo repo here


I suspect it was caused by one of the following PR's which have changed things in the routing and/or link-to area:

@rwjblue
Copy link
Member Author

rwjblue commented Nov 8, 2017

@bekzod - Would you mind taking a look at this? This is exactly the scenario (e.g. {{link-to without routing) that I was referring to in https://github.com/emberjs/ember.js/pull/15779/files#r148964352...

@bekzod
Copy link
Contributor

bekzod commented Nov 8, 2017

@rwjblue sure I am looking

@bekzod
Copy link
Contributor

bekzod commented Nov 8, 2017

@rwjblue sorry couldn't resolve this, dug a bit found inline link-to is ignoring first positional param
when didReceiveAttrs called params has index parameter only when Hi index passed https://github.com/emberjs/ember.js/find/master#L815 ,
I suspect it something to do with transform-inline-link https://github.com/emberjs/ember.js/blob/master/packages/ember-template-compiler/lib/plugins/transform-inline-link-to.js which is unfamiliar zone for me :)

@rwjblue
Copy link
Member Author

rwjblue commented Nov 8, 2017

Hmm. I didn’t think the issue was only for inline link-to. I’ll test though.

@simonihmig
Copy link
Contributor

Can confirm this.

I didn’t think the issue was only for inline link-to. I’ll test though.

This as well: happens for inline as well as block form of link-to!

simonihmig added a commit to simonihmig/ember.js that referenced this issue Nov 30, 2017
Fixes emberjs#15831

Fixes a regression introduced by emberjs#15788 by returning early again from `routing.generateURL()` when `router._routerMicrolib` is not present.
simonihmig added a commit to simonihmig/ember.js that referenced this issue Nov 30, 2017
Fixes emberjs#15831

Fixes a regression introduced by emberjs#15788 by returning early again from `routing.generateURL()` when `router._routerMicrolib` is not present.
simonihmig added a commit to simonihmig/ember.js that referenced this issue Nov 30, 2017
Fixes emberjs#15831

Fixes a regression introduced by emberjs#15788 by returning early again from `routing.generateURL()` when `router._routerMicrolib` is not present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants