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

component.trigger is not a function #3

Open
chrism opened this issue Jun 7, 2018 · 3 comments
Open

component.trigger is not a function #3

chrism opened this issue Jun 7, 2018 · 3 comments

Comments

@chrism
Copy link

chrism commented Jun 7, 2018

I can use perfectly (with ember-decorators)

import { CompatComponent as Component } from 'ember-glimmer-component';
import { classNames } from '@ember-decorators/component';
import { computed } from '@ember-decorators/object';

@classNames('static-class')
export default class extends Component {
  @computed('@filename', '@filetype')
  get tomsterPath() {
    return `/img/${this.filename}.${this.filetype}`
  }
}

But when I try with (removing ember-decorators)

import { Component } from 'ember-glimmer-component';

export default class extends Component {
}

I get this error in the console

Uncaught TypeError: component.trigger is not a function
    at CurlyComponentManager.create (ember-glimmer.js:3696)

This is the line of code it refers to

component.trigger('didReceiveAttrs');

I'm using the latest version of canary and my templates are very basic to test with, just simple html without even any properties for now.

The code is available to see here:
https://github.com/chrism/emberjs-2018/tree/glimmer-component

Any idea why this might be happening?

Much appreciated, thanks!

@smfoote
Copy link
Owner

smfoote commented Jun 7, 2018

Interesting. Perhaps something changed in the recent Ember releases.

@harokevin
Copy link

I had the same error but my problem was that I was importing Component from @ember/controller, not @ember/component'.

import Component from '@ember/controller';

I should have been using

import Component from '@ember/component';

@kmccullough
Copy link

I had the same error but my problem was that I was importing Controller from @ember/controller and extending from it, expecting a Component. If you convert a controller/tpl to a component, don't forget to actually change it to a component.

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

4 participants