Hi, I ran into an interesting problem while doing the ToDo intro tutorial that got me thinking about debugging. What is your mindset or approach when you have an issue that fails silently?
Example:
I have a template and events as specified in the TODO tutorial, and everything seems OK
As a newbie, this is something Iām not used to, eg. that things fail silently (my previous framework was dead simple Python Flask - No DDP magic). I would be more inclined to continue my exploration of Meteor if I knew that there is a debugging methodology to deal with these āsilentā situations.
Doesnāt Meteor having linting built into itās ācompilerā. So how can a third party linting tool help you beyond that? What I really want to is to be able to set breakpoints and step through the javascript code.
I just loaded up a new meteor project and added your code to the project.
The Template.task object exists
and the events fire.
Did you call the template in a parent html file? e.g. {{> task }}
where is your code declared? I assume you did not just put this into the HTML file:
Template.task.events({
'click .toggle-checked'() {
console.log("Does this event fire?")
},
'click .delete'() {
console.log("Does this event fire?")
},
});
PS: I am working on a fairly large project with Meteor. I have developed a pattern of going back to a simple project to verify I know how to accomplish a new thing before trying to integrate into a larger project. Works fairly wellā¦
Another option is to set a break point in the right spot and then just step through the .js I hope meteor was built in such a way that this is doable. If so, where to set the first breakpoint???!