Also, sentry dependency doesn't share in core app for other microfrontends.
When http error occurs interceptor in core app call Sentry.captureException(new Error(errorResponse.message))
Steps to Reproduce
init sentry in core app with mentioned below config
in microfrontend with module federation add config to webpack config as mentioned below
reproduce http error with status code 400-599
such error type get caught by common project because for some reason this condition "frame.module_metadata && frame.module_metadata.dsn" isn't true. However, when another error occurs (for example, method with throw error) it transport error to specific project as expected
Expected Result
transport http errors, which appoint in microfrontend with module federation, from core app by beforeSend to specific project
Actual Result
only http errors which appoint in microfrontend with module federation get caught by common project and can't transport by beforeSend because of false value of this condition "frame.module_metadata && frame.module_metadata.dsn"
Hi @tweety18. Because of the varied nature of microfrontend setups, could you help us dig deeper into this by sharing an example reproduction? That will allow us to debug this faster. Thanks!
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/angular
SDK Version
"@sentry/angular": "8.35.0" and "@angular-architects/module-federation": "^17.0.8"
Framework Version
"@sentry/angular": "8.35.0"
Link to Sentry event
can't provide, there is private repo
Reproduction Example/SDK Setup
As you mention in documentation, Sentry inits only once in core application. Sentry.init({ //ufo-core project dsn: environment.dsn, tracesSampleRate: 1.0, sampleRate: 1.0, environment: environment.name, sendDefaultPii: false, integrations: [ Sentry.browserTracingIntegration({}), Sentry.captureConsoleIntegration({levels: ['error']}), Sentry.extraErrorDataIntegration(), Sentry.httpClientIntegration({ failedRequestStatusCodes: [400, 599], }), Sentry.moduleMetadataIntegration() ], transport, beforeSend: (event) => { if (event?.exception?.values?.[0].stacktrace?.frames) { const frames = event.exception.values[0].stacktrace.frames; // Find the last frame with module metadata containing a DSN const routeTo = frames .filter( (frame) => frame.module_metadata && frame.module_metadata.dsn, ) .map((v) => v.module_metadata) .slice(-1);
})
In microfrontend with module federation I use this configs: module.exports = merge(baseConfig, { devtool: "source-map", plugins: [ SentryWebpackPlugin({ moduleMetadata: ({ release }) => ({ dsn: "dsn_path", release,
});
Also, sentry dependency doesn't share in core app for other microfrontends. When http error occurs interceptor in core app call Sentry.captureException(new Error(errorResponse.message))
Steps to Reproduce
Expected Result
transport http errors, which appoint in microfrontend with module federation, from core app by beforeSend to specific project
Actual Result
only http errors which appoint in microfrontend with module federation get caught by common project and can't transport by beforeSend because of false value of this condition "frame.module_metadata && frame.module_metadata.dsn"