You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// on a typescript component:importComponent,{hbs,tracked}from'@glimmerx/component';importAnotherfrom'./Another';exportdefaultclassAppextendsComponent{
@trackeddynamicObject;constructor(){// console.log(Another);window.setInterval(()=>{this.dynamicObject={dynamicDate: newDate().toString(),};},200);}statictemplate=hbs` <div id="intro"> <h3>Cool</h3> <Another @text="hello" @dynamicObject={{this.dynamicObject}}/> </div> `;}
The component above only works if I uncomment the console log above, the resolver cannot find/parse components imports correctly by just ts import Component from ./component or using it inside the hbs template, it needs the code to be referenced inside the Component js, even a useless console.log(Component) make that component render correctly.
Currently in the code above, without the console.log, render fails/app breaks with not a very helpful error:
setComponentManager.js:18 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
at Function.getPrototypeOf (<anonymous>)
at getComponentManager (setComponentManager.js:18)
at createComponentDefinition (definitions.js:33)
at definitionForComponent (definitions.js:15)
at CompileTimeResolver.lookupComponent (CompileTimeResolver.js:43)
at DefaultCompileTimeResolverDelegate.lookupComponent (delegate.js:68)
at resolveLayoutForTag (resolver.js:11)
at ifResolvedComponent (push-compile.js:150)
at compileOp (push-compile.js:64)
at pushCompileOp (push-compile.js:26)
When I turn the files into JS from TS everything works correctly, as expected.
Component parsing needs to be fixed in TS.
We should improve error messages such as this one.
The text was updated successfully, but these errors were encountered:
The component above only works if I uncomment the console log above, the resolver cannot find/parse components imports correctly by just ts
import Component from ./component
or using it inside the hbs template, it needs the code to be referenced inside the Component js, even a uselessconsole.log(Component)
make that component render correctly.Currently in the code above, without the console.log, render fails/app breaks with not a very helpful error:
When I turn the files into JS from TS everything works correctly, as expected.
The text was updated successfully, but these errors were encountered: