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

[Bug] [Canary] {{@component}} template compiler error #19313

Closed
buschtoens opened this issue Dec 17, 2020 · 7 comments · Fixed by #19320
Closed

[Bug] [Canary] {{@component}} template compiler error #19313

buschtoens opened this issue Dec 17, 2020 · 7 comments · Fixed by #19320

Comments

@buschtoens
Copy link
Contributor

buschtoens commented Dec 17, 2020

🐞 Describe the Bug

It seems that, if a template includes {{@component}}, the latest Ember canary fails with this error:

{{component}} requires a component definition or identifier as its first positional parameter, did not receive any parameters.
(error occurred in 'ember-cli-addon-docs/components/api/x-component/template.hbs' @ line 1 : column 61)
<h1 class="docs-h1" data-test-component-name>{{@component.name}}</h1>

https://github.com/ember-learn/ember-cli-addon-docs/blob/master/addon/components/api/x-component/template.hbs#L1

🔬 Minimal Reproduction

https://github.com/ember-intl/ember-intl/runs/1571041877#step:5:80

🌍 Environment

  • Ember: latest canary
@rwjblue
Copy link
Member

rwjblue commented Dec 21, 2020

Thank you for reporting!!!

@rwjblue
Copy link
Member

rwjblue commented Dec 21, 2020

@buschtoens - I believe this should have been fixed by #19317, the error was introduced by an Ember side AST transform.

Can you double check?

@buschtoens
Copy link
Contributor Author

buschtoens commented Dec 21, 2020

Sure! I've just installed the 9b9ec95 canary by updating the package.json entry for ember-source to https://s3.amazonaws.com/builds.emberjs.com/canary/shas/9b9ec9594c73cd3b8a6af06e415cd2c1398b8774.tgz. I also did a nombom and regenerated the yarn.lock file.

node_modules/ember-source/package.json shows the correct version: 3.25.0-canary+9b9ec959

The error still persists, but interestingly the message changed slightly. Now it's (component) instead of {{component}}.

Template Compiler Error (broccoli-persistent-filter:TemplateCompiler) in ember-cli-addon-docs/components/api/x-component/template.hbs

(component) requires a component definition or identifier as its first positional parameter, did not receive any parameters.: (error occurred in 'ember-cli-addon-docs/components/api/x-component/template.hbs' @ line 1 : column 61)
  - broccoliBuilderErrorStack: SyntaxError: (component) requires a component definition or identifier as its first positional parameter, did not receive any parameters.: (error occurred in 'ember-cli-addon-docs/components/api/x-component/template.hbs' @ line 1 : column 61)
    at generateSyntaxError (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:11330:17)
    at Object.assert (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:3656:52)
    at KeywordImpl.translate (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:3199:35)
    at Keywords.translate (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:3266:34)
    at NormalizationStatements.AppendContent (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4884:40)
    at NormalizationStatements.visit (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4803:23)
    at /Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4789:28
    at Array.map (<anonymous>:null:null)
    at NormalizationStatements.visitList (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4788:36)
    at ClassifiedSimpleElement.toStatement (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4767:30)
    at /Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4546:32
    at OkImpl.andThen (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:3035:14)
    at ClassifiedElement.toStatement (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4545:29)
    at NormalizationStatements.SimpleElement (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4874:132)
    at NormalizationStatements.visit (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4818:23)
    at /Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4789:28
    at Array.map (<anonymous>:null:null)
    at NormalizationStatements.visitList (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:4788:36)
    at normalize$1 (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:5034:28)
    at precompileJSON (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:6060:17)
    at precompile (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:6096:27)
    at Object.precompile (/Users/jan/open-source/ember-intl/node_modules/ember-source/dist/ember-template-compiler.js:20297:37)
    at Object.template (/Users/jan/open-source/ember-intl/node_modules/ember-cli-addon-docs/node_modules/ember-cli-htmlbars/lib/utils.js:179:38)
    at TemplateCompiler.processString (/Users/jan/open-source/ember-intl/node_modules/ember-cli-addon-docs/node_modules/ember-cli-htmlbars/lib/template-compiler-plugin.js:72:15)
    at Promise.then.output (/Users/jan/open-source/ember-intl/node_modules/broccoli-persistent-filter/lib/strategies/persistent.js:56:23)
    at initializePromise (/Users/jan/open-source/ember-intl/node_modules/rsvp/dist/rsvp.js:523:7)
    at new Promise (/Users/jan/open-source/ember-intl/node_modules/rsvp/dist/rsvp.js:1017:35)
    at /Users/jan/open-source/ember-intl/node_modules/broccoli-persistent-filter/lib/strategies/persistent.js:55:18
    at tryCatch (/Users/jan/open-source/ember-intl/node_modules/async-disk-cache/node_modules/rsvp/dist/rsvp.js:525:12)
    at invokeCallback (/Users/jan/open-source/ember-intl/node_modules/async-disk-cache/node_modules/rsvp/dist/rsvp.js:538:13)
    at publish (/Users/jan/open-source/ember-intl/node_modules/async-disk-cache/node_modules/rsvp/dist/rsvp.js:508:7)
    at flush (/Users/jan/open-source/ember-intl/node_modules/async-disk-cache/node_modules/rsvp/dist/rsvp.js:2415:5)
    at processTicksAndRejections (internal/process/task_queues.js:79:11)

Let me know, if there's any more info you need or whether I can do anything else to help.

@rwjblue
Copy link
Member

rwjblue commented Dec 22, 2020

Should be fixed on #19320 lands.

@rwjblue
Copy link
Member

rwjblue commented Dec 22, 2020

@buschtoens - Took me a minute in tracking this down due to a mismatch in what was actually running vs what seemed to be running.

The original report was RE: {{@component.name}}, but the actual code being ran in ember-intl's test suite was {{component.name}}. The ember-cli-addon-docs template was updated only recently to migrate from {{component.name}} to {{@component.name}} (in ember-learn/ember-cli-addon-docs@9bab07c).

@buschtoens
Copy link
Contributor Author

omg 🤦🏼‍♂️
Sorry for wasting your time!

I'll verify, once the fix lands in canary. 😇
Thank you.

@rwjblue
Copy link
Member

rwjblue commented Dec 22, 2020

Now that the fix has landed, I've submitted ember-intl/ember-intl#1482 to reenable canary testing on ember-intl.

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

Successfully merging a pull request may close this issue.

2 participants