Microfrontend support
Microfrontend support
This feature allows you to track multiple applications on the same page.
Only errors with stacktrace are supported.
Prerequisites
To support microfrontend, you need to install one of these plugins: webpack, esbuild, vite and include them in your build process.
CoralogixRum.init({
// ...
supportMfe: true,
});
When an error occurs, the SDK looks up the microfrontend of each frame in the stack trace and adds these labels to the error event:
mfeAppandmfeVersionname the microfrontend of the topmost frame, where the error was created. They are omitted when that frame belongs to the host application.mfeslists every microfrontend in the stack trace, nearest the topmost frame first, each as an object with its ownmfeApp,mfeVersionandframeIndexes.frameIndexeslists every row of the error'soriginal_stacktracethat belongs to that microfrontend, topmost first, where 0 is the topmost frame;mfeVersionis the version of the topmost of them. Rows are the frames the SDK reports, so they can differ from the lines the browser prints: native frames without a file, such asArray.forEach (<anonymous>), are not rows. Usemfesto find errors that passed through a microfrontend even when the host application reported them, for example through a shared error handler, afetchwrapper, orconsole.error. Available from version 4.1.0;frameIndexesfrom version 4.1.1.
For an error that the host application reports on behalf of a checkout microfrontend, which called into a cart microfrontend and back, the topmost frame belongs to the host, so the event carries only mfes:
{
"mfes": [
{ "mfeApp": "checkout", "mfeVersion": "1.4.0", "frameIndexes": [1, 3] },
{ "mfeApp": "cart", "mfeVersion": "2.0.3", "frameIndexes": [2] }
]
}
On error events, these labels replace any labels of the same name that you set with the labels option or setLabels. Labels you pass to captureError take precedence over them.