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

Errors on helpers with v1.1.0 #12

Closed
knownasilya opened this issue Jun 6, 2018 · 11 comments
Closed

Errors on helpers with v1.1.0 #12

knownasilya opened this issue Jun 6, 2018 · 11 comments

Comments

@knownasilya
Copy link

knownasilya commented Jun 6, 2018

I get this error:

vendor.js:71725 Uncaught TypeError: Cannot read property 'manager' of null
    at RuntimeResolver.runtimeResolver._lookupComponentDefinition (vendor.js:71725)
    at RuntimeResolver.lookupComponentDefinition (vendor.js:40540)
    at CompileTimeLookup.lookupComponentDefinition (vendor.js:38443)
    at refineInlineSyntax (vendor.js:40373)
    at Inlines.compile (vendor.js:19102)
    at vendor.js:18871
    at Compilers.compile (vendor.js:18738)
    at CompilableTemplateImpl.compile (vendor.js:19508)
    at OutletComponentManager.getLayout (vendor.js:37035)
    at Object.evaluate (vendor.js:23286)

The component it tries to evaluate is page-title, but that addon supports using just title which is transformed via AST. See my comment in that project ember-cli/ember-page-title#123 (comment)

I'm testing converting it to an explicit page-title.

@knownasilya
Copy link
Author

knownasilya commented Jun 6, 2018

Converting it to page-title directly still errors, see the error here: https://gloucesterma.mapgeo.alpha1.appgeo.com/dashboard/

Looks like helpers with a - are treated as components? So the {{title was a red herring since it was always converted to {{page-title any ways. Interesting thing is that it doesn't error locally when running on my machine. The only think I'm doing differently in alpha is using EMBER_ENV=alpha when building.

@knownasilya
Copy link
Author

knownasilya commented Jun 6, 2018

Didn't notice that 1.1.0 was out, trying that now..

Nope, still an issue.

@knownasilya
Copy link
Author

Ah, alpha was already using 1.1 but local was 1.0.2, so the issue is somewhere in the update from 1.0.2 to 1.1.0.

@knownasilya knownasilya changed the title Errors on {{title}} helper from ember-page-title Errors on helpers with v1.1.0 Jun 6, 2018
@rwjblue
Copy link
Member

rwjblue commented Jun 6, 2018

Can you give me the template that I can use to test?

@knownasilya
Copy link
Author

knownasilya commented Jun 6, 2018

@rwjblue
Copy link
Member

rwjblue commented Jun 6, 2018

Thank you very much for putting together an awesome reproduction, it made tracking things down super easy!

@lifeart
Copy link

lifeart commented Sep 14, 2018

Seen same issue on "ember-source": "~3.1.0"
Can reproduce this problem only on prod build, ind dev build - all ok

image

@rwjblue
Copy link
Member

rwjblue commented Sep 15, 2018

Can you create a reproduction repo which demonstrates the problem (if so please create a new issue so we can track things down and get it fixed...)

@lifeart
Copy link

lifeart commented Sep 15, 2018

@rwjblue this is my code issue, sorry for bothering you :(
I have dynamic component name resolution logic like

function componentName(modelName, viewType) { 
    return `meta-attribute/${modelName}/x-${viewType}`;
}

if component having this name resolved in app - all ok, if not - I see this issue.

Prod/Non-prod behavour - is my logic how to get modelName.

I have logic like let modelName = model.constructor.name
but in prod, constructor class may have short name (due to minification). (meta->g)

Issue solved for me by let modelName = model.constructor.modelName .

To prevent users from tricky debugging, error stack may be little bit usable, for example it may contain error like -
I'm trying to render unresolved componenent "componentName" .

@rwjblue
Copy link
Member

rwjblue commented Sep 15, 2018

Great job tracking this down! Seems like we could write a test that emulates the issue you are seeing (so that we can track it down). I’m thinking of essentially a test like this one but using {{component ‘does-not-exist’}} and asserting empty DOM. Would you mind sending a PR with that test?

lifeart added a commit to lifeart/ember-angle-bracket-invocation-polyfill that referenced this issue Sep 15, 2018
@lifeart
Copy link

lifeart commented Sep 15, 2018

Done, but this is not ember-angle-bracket-invocation-polyfill issue.
Non prod builds users have pretty meaningful error like:

Uncaught Error: Assertion Failed: Could not find component named "does-not-exist" (no component or template with that name was found)

But, this issue may be in prod builds due to removed checks.

https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/glimmer/lib/resolver.ts#L126
https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/glimmer/tests/integration/components/contextual-components-test.js#L745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants