Need Help: HTML Template "Uncaught ReferenceError: update is not defined"

Hi everyone!

I’m very new to CasparCG, and I must say that first-impressions are really good, once I understood the basics.
I’m now trying to make some basic Lowerthird- html template, but once i add it to Caspar and try to run the template it I get the following in the server console

[0311/111953:ERROR:renderer_main.cc(226)] Running without renderer sandbox
[0311/111953:INFO:CONSOLE(0)] "Uncaught ReferenceError: update is not defined", source: file:///C:/Users/johan/Desktop/CasparCG%20Server%202.0.7%20(1)/CasparCG%20Server/Server/templates//TEST.html (0)
[0311/111953:INFO:CONSOLE(0)] "Uncaught ReferenceError: play is not defined", source: file:///C:/Users/johan/Desktop/CasparCG%20Server%202.0.7%20(1)/CasparCG%20Server/Server/templates//TEST.html (0)

It happens with various HTML files. Thankful for help =)

There need to be JavaScript functions for play() stop() and update() at minimum For Caspar to update the variable data (update), start the intro animation (play) and start the outro animation (stop).

Thank you for helping! I added some functions, and the ReferenceErrors vanished thankfully.
But this Error still remains, you don’t happen to know what causing that?

[0311/125356:ERROR:renderer_main.cc(226)] Running without renderer sandbox

I do get that one also all the time and never noticed any effect on the output.

Hmmm, then I’m doing something else wrong I guess.

Could i maybe bother you for a file that works for you, to trouble shoot were my problem is?

No, by saying:

I mean you safely can ignore it.

1 Like

Yes, I got that part.

But still im not getting anything any of the graphics on screen :confused:
Playing videos and images are working just fine though.

This is an example, that Martin Wacker @Martastain created.

In some versions of CasparCG you get these (misleading) error message when it’s unable to access the HTML template file at all. It’s complaining about missing update() and play() functions, when in fact it’s missing the template file entirely.

Thank you!
The example worked, so then i just have to make my own file work =)

Thats intresting behavior, thank you for clarifying =)

If you are using any script file and getting "Uncaught ReferenceError: x is not defined " which means ‘x’ is either a variable or a method which you are trying to use before declaring it using var keyword. This means that there is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this ‘x’ is not defined error . This usually indicates that your library is not loaded and JavaScript does not recognize the ‘x’.

To solve this error: Load your library at the beginning of all your scripts.

There can be multiple other reasons for this issue:

  • Conflict with Other Libraries
  • Path to your library included is not correct
  • Llibrary file is corrupted
  • Working offline (when you use CDN)