[APM] Error thrown when creating watcher #46454
Labels
bug
Fixes for quality problems that affect the customer experience
good first issue
low hanging fruit
Team:APM
All issues that need APM UI Team support
When creating a watch an error is thrown. The watch is successfully created but the success toast is never displayed.
Why the error occurs
The error occurs because the success toast contains
KibanaLink
.KibanaLink
contains a hook (useKibanaCore
) that relies on context. Since the content inside a toast is moved outside the root of the APM React app (using portals) the component doesn't have access to expected context, and the error is thrownReproduce:
Expected result: A success toast is displayed with a link to the created watch
Actual result: No toast is displayed
Suggested solution
Make it possible to pass
core
as a prop toKibanaLink
:pass
core
toKibanaLink
in WatcherFlyoutError details:
Related
kibana/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/MachineLearningFlyout/index.tsx
Lines 116 to 126 in 2b866be
The text was updated successfully, but these errors were encountered: