nxtedition / create-caspar-graphics

A tool for building, testing and packaging HTML graphics for CasparCG using code.
https://gfx.nxtedition.com
75 stars 16 forks source link

Got errors in the log when trying example? #91

Closed 7u5a closed 2 days ago

7u5a commented 7 months ago

I get these errors in my log, when trying your example template

[2024-01-26 16:22:16.090] [info] Received message from 127.0.0.1: CG 1-20 ADD 0 "EXAMPLE" 1 "<componentData id=\"name\"><data id=\"text\" value=\"Tue Sandbæk\"/>"\r\n [2024-01-26 16:22:16.090] [info] Sent message to 127.0.0.1:202 CG OK\r\n [2024-01-26 16:22:16.095] [info] html[file://C:\casparcg-server-v2.3.3-lts-stable\template/EXAMPLE.html] Destroyed. [2024-01-26 16:22:16.245] [info] html[file://C:\casparcg-server-v2.3.3-lts-stable\template/EXAMPLE.html] 1920 1080 50.000000 Log: Qg.update({ [2024-01-26 16:22:16.245] [info] "name": { [2024-01-26 16:22:16.245] [info] "text": "Tue Sandbæk" [2024-01-26 16:22:16.245] [info] } [2024-01-26 16:22:16.245] [info] }) [2024-01-26 16:22:16.245] [info] html[file://C:\casparcg-server-v2.3.3-lts-stable\template/EXAMPLE.html] 1920 1080 50.000000 Log: Qg.play() [2024-01-26 16:22:16.252] [error] html[file://C:\casparcg-server-v2.3.3-lts-stable\template/EXAMPLE.html] 1920 1080 50.000000 Log: Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btext%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings. [2024-01-26 16:22:16.252] [error] html[file://C:\casparcg-server-v2.3.3-lts-stable\template/EXAMPLE.html] 1920 1080 50.000000 Log: Uncaught Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btext%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

What do i miss?

tobiasandersen commented 7 months ago

You're sending name as an object, but you probably want it to be a string? Or use name.text in your template?

7u5a commented 7 months ago

I was testing this example.zip example.zip Did'nt change anything, just build it from your create-caspar-graphics

7u5a commented 7 months ago

By the way. When I try to run this template with Caspar CG Client, I get these errors. But when I do it with SuperConductor, there is no problem. Why is that?

tobiasandersen commented 7 months ago

The problem is how the data is sent. The template is expecting name to be a string, but you're sending an object that contains a property text (which is a string).

7u5a commented 7 months ago

I did'nt know, but I've found the error. image Had to check this box...

tobiasandersen commented 7 months ago

It could be that the XML parsing is wrong here, I've never used it myself. When you used that data (as seen on your last picture), but didn't click "Send as JSON", you got the problem you originally posted?

7u5a commented 7 months ago

yes @tobiasandersen it seems it is when sending data not as json. If I need to be able to send data without json, is it then the template og is it the casparcg server?

tobiasandersen commented 7 months ago

I think it should work better in graphics-kit@2.0.0-alpha.24

7u5a commented 7 months ago

And what’s that, and where to find it?

tobiasandersen commented 7 months ago

I'm referring to this package: https://www.npmjs.com/package/@nxtedition/graphics-kit. I released an update yesterday where this should be fixed.

7u5a commented 7 months ago

I'll try