question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with @tracked

See original GitHub issue

I am running into issues setting and consuming a changeset at the same time.

I have the following in a Glimmer component:

// component.ts
export default class Dummy extends Component {
  @tracked changeset: BufferedChangeset;

  get otherProperty() {
    return this.changeset.property
  }
 
  @action
  setProperty() {
    this.changeset.set('property', {});
  }
}
// template.hbs
{{log this.changeset.property}}

I get the following error:

Error: Assertion Failed: You attempted to update [object Object].property to "[object Object]", but it is being tracked by a tracking context, such as a template, computed property, or observer. In order to make sure the context updates properly, you must invalidate the property when updating it. You can mark the property as `@tracked`, or use `@ember/object#set` to do this.

As you can see changeset is marked as @tracked, but that didn’t seem to help.

If I just set the value, without consuming it in the template or another property, I don’t get the error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
snewcomercommented, May 12, 2020

Thanks @basz! I have a solution in the linked issue. Effectively b/c Ember.set does not handle Ember.set({}, 'user.name', 'foo'), we need to keep our own setDeep logic but when property assignment happens at each level of the tree, we use Ember.set. Will look to get in and update e-c by the end of the day!

0reactions
baszcommented, May 12, 2020

anything I can do to help?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is Issue Tracking? Issue Tracking Definition ... - Airfocus
Issue tracking is the process of recording customer complaints and problems so that they can be resolved in an organized fashion. Issue tracking...
Read more >
Issue tracking system - Wikipedia
An issue tracking system (also ITS, trouble ticket system, support ticket, request management or incident ticket system) is a computer software package that ......
Read more >
The 9 Best Issue Tracking Software Systems in 2022
Issue tracking software is a customer service and support tool that records incoming support cases from start to finish.
Read more >
What is issue tracking system (ITS)? - ProProfs Help Desk
Issue tracking is a tool is a customer service tool which helps organizations manage and resolve issues in a variety of departments.
Read more >
15 Best Issue Tracking Software for 2022 - Zendesk
Make it easy to manage, track, and resolve tickets, incidents, and problems with the best issue tracking software. Learn more in this guide....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found