[3.1.0] Cannot read property 'fullName' of undefined
See original GitHub issueWe have the following (maybe hacky?) code:
import Service from '@ember/service'
import Component from '@ember/component'
import { getOwner, setOwner } from '@ember/application'
import { Promise } from 'rsvp'
export default Service.extend
_getRenderer: (owner) ->
owner.lookup('renderer:-dom')
render: (template, context) ->
new Promise (resolve) =>
# create a new component
owner = getOwner(this)
component = Component.create
style: 'display:none;' # hide it
layout: Ember.HTMLBars.compile(template)
renderer: @_getRenderer(owner)
setOwner(component, owner)
component.setProperties(context)
component.one 'didRender', ->
element = @element.cloneNode(true)
component.destroy()
resolve(element)
# append the component to the body to make it render
component.append()
This used to work fine until (including) 3.0.0
. 3.1.0
broke it - calling “append” leads to:
Uncaught TypeError: Cannot read property 'fullName' of undefined
at new RootComponentDefinition (ember-glimmer.js:4485)
at InteractiveRenderer.appendTo (ember-glimmer.js:4702)
at Class.exports.default._emberMetal.Mixin.create._Mixin$create.appendTo (view_support.js:135)
at Class.exports.default._emberMetal.Mixin.create._Mixin$create.append (view_support.js:139)
at Ember.RSVP.Promise.resolve (template-to-dom.js:31)
...
It is blowing up because var factory = _container.FACTORY_FOR.get(component);
returns undefined (for the component that we create in the code above).
I know we are using somewhat private APIs (append
) but what has changed in the new Ember and how do we fix it?
Thanks for the great framework!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Push fails in GitKraken with errormessage ... - Stack Overflow
Push fails in GitKraken with errormessage "Push Failed cannot read property 'fullName' of undefined" · Ask Question. Asked 5 years, 9 months ago....
Read more >Push Fails In Gitkraken With Errormessage "Push ... - ADocLib
Js Typeerror: Cannot Read Property 'Fullname' Of Undefined. JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible....
Read more >error typeerror: cannot read properties of undefined ... - You.com
The "Cannot read property 'includes' of undefined" error occurs when calling the includes() method on an undefined value. To solve the error, make...
Read more >TypeScript Deep Dive
TypeScript Deep Dive is one of the best technical texts I've read in a while. ... TypeScript team doesn't use null : TypeScript...
Read more >Bug listing with status RESOLVED with resolution TEST ...
... Bug:19759 - "rc4 CD boots up to install and doesn't detect either ... fails with undefined reference to OtsMove" status:RESOLVED resolution:TEST-REQUEST ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The error is essentially because the component you are creating and rendering is not being created through the normal owner interface (you have already worked around a similar issue when you added
this._getRenderer
and manually setting owner).The quickest work around for you would be (sorry gotta use JS since my coffeescript is super bad):
This lets you remove the manual population of renderer and owner (I believe), but the code here still seems pretty non-idiomatic and brittle to other future framework changes. I’d suggest trying to come up with a way to refactor away from this pattern…
hi, @rwjblue , i had the same problem. thanks for your solution .
first, this source code , and can we update by adding Null check to suppress error ?
although i accept to declare component in ember way , we can’t prevent the
create
invoked .