You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript's errors raised when executing code sent from the server-side (e.g. Page.executeJs()) cannot be traced in production because Flow client silently suppresses them.
To be able to trace errors from the server-sent JavaScript code in production mode, we may need to tweak the Flow client Console.reportStacktrace() method.
public static void reportStacktrace(Exception exception) {
if (GWT.isScript()) {
if (shouldLogToBrowserConsole) {
doReportStacktrace(exception);
}
} else {
exception.printStackTrace();
}
}
where shouldLogToBrowserConsole = !ApplicationConfiguration.isProductionMode
It seems to me that instrumenting the GWT generated JavaScript code is not possible, or at least not easy to accomplish.
Something we can maybe do is to add a traceErrors flag in Flow client ApplicationConfiguration, propagate it to Console and change the above method to consider also this configuration.
Then, if we do not want the developers to be able to set the configuration on their own, we can try to add an instrumentation in Observability Kit that intercepts BootstrapHandler$ApplicationParameterBuilder.getApplicationParameters and adds the flag to the returned JsonObject.
The text was updated successfully, but these errors were encountered:
JavaScript's errors raised when executing code sent from the server-side (e.g.
Page.executeJs()
) cannot be traced in production because Flow client silently suppresses them.vaadin/flow#2028
vaadin/flow#2963
To be able to trace errors from the server-sent JavaScript code in production mode, we may need to tweak the Flow client
Console.reportStacktrace()
method.where
shouldLogToBrowserConsole = !ApplicationConfiguration.isProductionMode
It seems to me that instrumenting the GWT generated JavaScript code is not possible, or at least not easy to accomplish.
Something we can maybe do is to add a
traceErrors
flag in Flow clientApplicationConfiguration
, propagate it toConsole
and change the above method to consider also this configuration.Then, if we do not want the developers to be able to set the configuration on their own, we can try to add an instrumentation in Observability Kit that intercepts
BootstrapHandler$ApplicationParameterBuilder.getApplicationParameters
and adds the flag to the returnedJsonObject
.The text was updated successfully, but these errors were encountered: