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

Cannot read properties of undefined (reading 'name') in first line of every template #411

Open
SirPhoros opened this issue Jan 30, 2024 · 5 comments

Comments

@SirPhoros
Copy link

In every template.hbs that I have, in the first, I seem to keep receiving the following error Cannot read properties of undefined (reading 'name')glimmer-engine(syntax)

However, there's no name in said templates, so I presumed it has something to do with the way glimmer-engine is configured, but I don't seem to catch where it is coming from.

It doesn't matter whether the first line is a moustache, a semantic tag or even a line break, it will report that said error occurs in the file (although, it does not prevent it from compiling and rendering).

Does anybody more experience have an idea of how to solve this annoying error?

@NullVoxPopuli
Copy link
Contributor

thanks for reporting!

  • what versions are you using?
  • do you have a reproduction?

@SirPhoros
Copy link
Author

SirPhoros commented Jan 31, 2024

Hi! Thank you so much for answering so quickly!

Well, in our package.json we have the following packages:

    "@glimmer/tracking": "^1.1.2",
   ... 
      "ember-cli": "4.12.2", 

And literally almost everything could be a reproduction, but for example:

<EmberTooltip
 @event={{this.event}}
 @isShown={{@isShown}}
 @side={{this.side}}
 @targetId={{@targetId}}
 @tooltipClass={{this.styleNamespace}}
 ...attributes
>
 {{#if @text}}
   {{@text}}
 {{else}}
   {{yield}}
 {{/if}}
</EmberTooltip>

Then, in the first line: Cannot read properties of undefined (reading 'name')glimmer-engine(syntax) when visibly, there's no instance that name has been mentioned. It can happen if we are just getting a blank line as first line, if it is a conditional or if we are opening a block as well.

However, we have a few instances like:

<div class={{this.styleNamespace}} ...attributes>
 {{yield}}
</div>

That seems not to trigger this problem.

Thinking about that, maybe the root resides on the component, but I cannot figure it out

@NullVoxPopuli
Copy link
Contributor

so since this seems to be runtime error, what does the compiled output of your problematic template look like?

@SirPhoros
Copy link
Author

That's the issue, everything looks correct, and nothing changed from when this flag started to appear.

@NullVoxPopuli
Copy link
Contributor

a repro repo would be most helpful <3

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

2 participants