-
• #2
...since
the console.log()
uses the same and only available 'communication channel' it interferes with the upload... therefore, put your code into a setTimeout() function, or - even better - into 'the'onInit(){ ... }
function and add the timeout to the code like this:function onInit() { // your code } setTimeout(onInit,999); // while dev, remove before upload for save()
-
• #3
Thanks for explaining the background on the communication channel - seeing this I now understand the reason for the error.
Using your code snippet fixed the error, thanks for that, also!
-
• #4
I'm not sure if this helps, but:
Expecting a function to call, got Number at line 1 col 1 reset();
would happen if you did something like
global.reset=1
which setreset
to a number. It seems unlikely that you would have done that however -
• #5
Thanks for your idea & feedback, Gordon!
This error occurs prior to loading code to the puck, seems to be during the (standard) reset during the upload procedure - AFAIK there was some switch to "disable reset upon code upload" in the Web IDE...
-
• #6
The standard reset procedure involves just calling
reset()
- so if you had setglobal.reset=a_number
for some reason this is exactly the error you'd get. For example:>global.reset=1; =1 >reset() Uncaught Error: Expecting a function to call, got Number at line 1 col 1 reset() ^
-
• #7
Thanks Gordon - that's it! That was the issue - I did have a variable called "reset" which caused this behaviour... Sorry, my bad...
Renaming fixed it - the error is gone - thanks again!Will now close this thread
Hi all,
been working with the puck.js for a while now and every now and then I get an error upon loading code (via WebBT/Chrome) to my puck.
It seems to trigger a reset which seems to fail:
See also attached screenshot - this happens even when just loading one line of code to the puck...
(hard-)resetting the puck fixes that for a while, but the issue eventually comes back.
Any ideas?
1 Attachment