Closed mherwege closed 1 year ago
This might actually need to be moved to the openhab-js repo as that's where the error is actually occurring. @florian-h05, this should be supported buy time.toZDT() right? I can't imagine something changed on this point so it's kind of weird to start happening now.
I‘ll move this to openhab-js, and I already have a suspect for the error:
I guess this if check does not evaluate to true and therefore toZDT runs into throwing an error at the end.
The problem is a bit more complicated:
Normally, you'd do an instance of check, however this doesn't work because it introduces a circular dependency.
Object.constructor.name
does not work because webpack renames functions, I will have to find another solution.
I was able to fix the issue by configuring webpack to keep class and function names.
The problem
I have the following in a blockly rule:
The offending line in the code view is (application/javascript):
Running this rule it does not run through and I get this error in the log:
Expected behavior
Conversion from a DateTimeItem state to a time.ZonedDateTime works.
Your environment
I am running blockly using the JavaScript (ECMAScript 2022+) addon and using built-in variables and included library.