Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
7.119.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
Similarly to #13297, I am using a loader script and moduleMetadataIntegration seems to be unavailable when using loader script.
I need this integration as advised for micro-frontend environment, and to use that solution I am migrating from Sentry SDK 5.30.0 to 7.119.0, which is already challenging.
Any reason to not have a dedicated bundle for this integration like other integration have?
This is a necessity for micro-frontend environment so I really hope there's a way to work around it .
Would appreciate your help in the matter. 🙏
Steps to Reproduce
Use loader script for 7.x version.
Have this script above:
<script>// Configure sentryOnLoad before adding the Loader Script// https://docs.sentry.io/platforms/javascript/install/loader/#custom-configurationwindow.sentryOnLoad=function(){console.log('sentryOnLoad')console.log(window.Sentry)window.Sentry.init({// moduleMetadataIntegration is a required integration for having the module_metadata available in runtimeintegrations: [window.Sentry.moduleMetadataIntegration()],// Solution for getting the route to the unhandled error.// This is the recommended solution for micro-frontend environment.beforeSend: function(event){if(event?.exception?.values?.[0].stacktrace.frames){constframes=event.exception.values[0].stacktrace.frames;// Find the last frame with module metadata containing a DSNconstframesModuleMetadata=frames.filter((frame)=>frame.module_metadata&&frame.module_metadata.dsn,).map((v)=>v.module_metadata)constrouteTo=framesModuleMetadata.slice(-1);// using top frame only - you may want to customize this according to your needsif(routeTo.length){event.extra={
...event.extra,ROUTE_TO: routeTo,};}}returnevent;}})}</script>Expected Result
Sentry is initialized successfully.
Actual Result
TypeError: Sentry.moduleMetadataIntegration is not a function
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
7.119.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
Similarly to #13297, I am using a loader script and
moduleMetadataIntegrationseems to be unavailable when using loader script.I need this integration as advised for micro-frontend environment, and to use that solution I am migrating from Sentry SDK
5.30.0to7.119.0, which is already challenging.Any reason to not have a dedicated bundle for this integration like other integration have?
This is a necessity for micro-frontend environment so I really hope there's a way to work around it .
Would appreciate your help in the matter. 🙏
Steps to Reproduce
Use loader script for 7.x version.
Have this script above:
Expected Result
Sentry is initialized successfully.
Actual Result
TypeError: Sentry.moduleMetadataIntegration is not a function