Kibana 8.19.17 fails to start after upgrade with FATAL Error [ERR_REQUIRE_ESM] in @elastic/charts

Hi everyone,

I am experiencing a crash loop with Kibana version 8.19.17 after upgrade on Rocky Linux 9.8 (Kernel 5.14). The service starts but crashes and restarts every ~20 seconds.

Error Logs

Here is the fatal error captured from the journal logs:

FATAL  Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/share/kibana/node_modules/@elastic/charts/node_modules/uuid/dist-node/index.js from /usr/share/kibana/node_modules/@elastic/charts/dist/components/chart.js not supported.
Instead change the require of index.js in /usr/share/kibana/node_modules/@elastic/charts/dist/components/chart.js to a dynamic import() which is available in all CommonJS modules.

Can someone help? I did not get any king of errors during the upgrade and the cluster nodes are running without problems.