HEADS-project / training

Training material to get started with the HEADS technologies
10 stars 16 forks source link

Fatal error: Cannot call method 'findByPath' of null #40

Closed skorsky closed 9 years ago

skorsky commented 9 years ago

Running step 4 of 2.Kevoree_Basics (JS), I get Fatal error: Cannot call method 'findByPath' of null when stopping the Kevoree runtime with Ctrl-C.

maxleiko commented 9 years ago

Step 4 of 2.Kevoree_Basics ? You mean 4.Its_About_Sending_A_Message ?

skorsky commented 9 years ago

Yes.

maxleiko commented 9 years ago

Can you send me your project, because I've just tested the 4. on Linux and Windows and it works.

skorsky commented 9 years ago

Trying to reproduce this and isolate it, I found that if clearInterval(this.id); in the stop function causes this if this line is missing.

maxleiko commented 9 years ago

Which command-line application do you use ?
Because it looks like there is none that are trustworthy on Windows :-1:

skorsky commented 9 years ago

Following the tutorial readme, I used grunt kevoree.

maxleiko commented 9 years ago

Not the command you ran, the command-line tool/application you are using.

Windows default one ? PowerShell ? Cygwin ?

skorsky commented 9 years ago

Windows default one cmd.

maxleiko commented 9 years ago

Can you try with PowerShell if you have it ?

skorsky commented 9 years ago

Works with PowerShell!

maxleiko commented 9 years ago

Tsss, I hate this Operating System.

maxleiko commented 9 years ago

How am I supposed to find out why it does not work with the default command-line application ?

maxleiko commented 9 years ago

@brice-morin any idea (besides "Windows sucks" because everyone know that) ?

brice-morin commented 9 years ago

Well, I do not know. I guess we should at least strongly recommend using PowerShell in the README. Because fixing that issues for any shell on Windows seems like dark magic...

skorsky commented 9 years ago

Why not point out, that clearInterval(this.id); is necessary in the stop function? If this is called during stop, all is fine.

maxleiko commented 9 years ago

clearInterval(this.id) is already in the stop function call

skorsky commented 9 years ago

Yes, in the committed source.

But when I come from exercise 1 (2.Kevoree_Basics/1.HelloWorld/js/), then this line is not in the source of stop.

maxleiko commented 9 years ago

The hang happens because you have to clear the interval you start in your components start functions. If you do not do so, the Kevoree runtime will not be able to properly ends its process while issuing a Ctrl-c because it still has some functions that has to run on each delayed interval.

That's why each components has there own lifecycle methods, so that you can clean things like this when the stop is called.
I will add something in the README to specify that

maxleiko commented 9 years ago

That was already stated here