Threshold alert rule issue with 5.9.0 JavaScript library

I have one system on OH5.0 M1. I just updated the JavaScript library to 5.9.0 via npm (openHAB JavaScript library releases - #36 by florian-h05). Now when the Threshold Alert rule from the marketplace runs, I get this:

2025-03-18 19:15:04.802 [ERROR] [.handler.AbstractScriptModuleHandler] - Script execution of rule with UID 'BatteryNotReporting' failed: java.lang.NullPointerException

I also have a 4.3.3 OH which was updated, and I get a differnt error:

2025-03-18 19:48:25.527 [ERROR] [.handler.AbstractScriptModuleHandler] - Script execution of rule with UID 'BatterySensorNotReporting' failed: org.graalvm.polyglot.PolyglotException: TypeError: Cannot load CommonJS module: '@runtime'

Not sure how to debug this further - any suggestions? Everything else on the systems appear to continue to work fine.

That looks weird, I can’t imagine why that should happen.
Have you tried restarting openHAB?

I have not tested my rule templates with the latest openhab-js yet. But I do not import and use @runtime directly in any of my templates and unfortunately the null pointer exception doesn’t indicate where in the rule the error occured.

Do you have the full stack trace for that first error?

Based on what’s changed, there shouldn’t be anything that breaks Threshold Alert. So these errors are indeed very weird.

I’ve restarted OH and so far I don’t see issues, but it will take some time to be sure…

A restart solved it. FYI - there was nothing else in the log, no stack trace. For future reference in case some else stumbles on this.