papegaaij opened a new issue, #1647:
URL: https://github.com/apache/wicket/issues/1647
`wicket-examples/src/main/java/org/apache/wicket/examples/websocket/charts/charts.js`
parses every pushed message with `jQuery.parseJSON(message)` (line 99).
jQuery 4 removed `jQuery.parseJSON`, and master now defaults to jQuery 4
(`JavaScriptLibrarySettings` uses `JQueryResourceReference.getV4()`). The
examples do not override that, so every `/websocket/message` on the charts page
throws `TypeError: jQuery.parseJSON is not a function` and the chart is no
longer updated by server pushes. Started with `-Dwicket.examples.use=VANILLA`,
the page does not load jQuery at all and the same line fails with a
`ReferenceError`.
I checked the call itself in headless Chrome:
`jQuery.parseJSON('{"year":2024}')` returns the object with jQuery 3.7.1 and
throws the `TypeError` above with 4.0.0. jquery-migrate 4.0.2 flags it as
"jQuery.parseJSON is removed; use JSON.parse". I did not run the charts example
itself end to end.
Proposed fix: replace the call with `JSON.parse(message)`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]