Skip to content

[Bug canary] @tracked with uninitialized property throws runtime error #17764

Closed
@chriskrycho

Description

@chriskrycho

If you write a component like this:

import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';

export default class ItBroken extends Component {
  @tracked data;

  get ugh() {
    return this.data;
  }
}
{{this.ugh}}

Then you see this error:

null is not an object (evaluating 'initializer.call')

The problem is here – it should check for both null and undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions