Vaadin 14.3.3, flow 2.3.3. I am working on an unfamiliar code base, and the browser suddenly shows the following issue:
(ReferenceError) : Polymer is not defined client-5F17FE7D56927576AB18BC8D06949321.cache.js:212:20
XC client-5F17FE7D56927576AB18BC8D06949321.cache.js:212
Xn client-5F17FE7D56927576AB18BC8D06949321.cache.js:1003
Wn client-5F17FE7D56927576AB18BC8D06949321.cache.js:774
Yn client-5F17FE7D56927576AB18BC8D06949321.cache.js:594
cu client-5F17FE7D56927576AB18BC8D06949321.cache.js:1016
bu client-5F17FE7D56927576AB18BC8D06949321.cache.js:973
_t client-5F17FE7D56927576AB18BC8D06949321.cache.js:575
The stacktrace tells nothing to me since it's an obfuscated GWT product which Flow uses internally.
Luckily there is a warning line The error has occurred in the JS code: '$0, Polymer.RenderStatus.beforeNextRender($0, () => $0.render());' which contains a lead that navigates me to the following server-side Java code:
attachEvent.getUI().getPage().executeJavaScript("Polymer.RenderStatus.beforeNextRender($0, () => $0.render());", calendar.getElement());
The exception should clearly state that the JavaScript code is coming from a server-side call to executeJavaScript() or similar. If that's not possible, then the warning line should be an error line clearly stating what's wrong and where the JavaScript code originates from.
For the server given JS executions, we should wrap those so that the failure is visible in the UI on development mode and like pointed out ^ make it clear that what is the source of the exception. For production mode the error should be highlighted in the console (but not UI).
Most helpful comment
For the server given JS executions, we should wrap those so that the failure is visible in the UI on development mode and like pointed out ^ make it clear that what is the source of the exception. For production mode the error should be highlighted in the console (but not UI).