-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Sentry.moduleMetadataIntegration is not a function when using loader script #13803
Comments
@gilisho I don't think there is a specific reason for that, we should include this in our CDN so you can lazy-load it in you application. I'll put this on our backlog for now, PRs are also welcome of course! For your application I'm afraid the only option right now is to use the integration via npm installation of our SDK. |
@gilisho nice! For general contributing guidelines check https://github.com/getsentry/sentry-javascript/blob/develop/CONTRIBUTING.md So I think the @Lms24 can you maybe chime in for handling v7 updates? |
It seems that I need to make changes and create a PR against |
@gilisho yes once a pr on v7 is merged we can trigger a release |
I made 2 PRs for both v8 and v7. LMK if something is missing. Since my platform is using v7 ATM, #13822 is in a higher priority for me. I'd like to know when this can get released to a new version. Waiting for this to get released. 🙏 |
@gilisho thank you! We'll take a look 👍 |
Thank you! I added the test you requested for #13817. LMK if something else is needed for both PRs. Some concerns have been raised though:
|
Hi, I see both PRs against v8 and v7 are still open. Let's try to get the v8 one in first and then take a look at v7. Sorry that this is taking a while but we're a bit busy and when it comes to adding build/release artifacts we need to be extra careful. |
Hi, before we merge these PRs, would you mind explaining your use-case in a bit more detail? Personally, something feels off about having microfrontends + the loader. We need to be a bit more gatekeep-y with what we add to the loader because of bundlesize. Btw I am guessing you would also need the multiplexed transport? |
Hi @lforst, thanks for the response!
I have one Sentry instance which is initialized using the Loader script in the host. The microfrontends are rendered inside this host and we use the micro-frontend solution for the host Sentry instance.
Yes, I have raised this concern earlier. @mydea already addressed that here and I am okay with the solution he proposed. |
@gilisho that makes sense. That is actually a valid use-case. Thanks for explaining! Let's get it merged then. |
…3817) This PR fixes #13803, and adds support for `moduleMetadataIntegration` to be lazy loaded, in [this](https://docs.sentry.io/platforms/javascript/configuration/integrations/#2-load-from-cdn-with-lazyloadintegration) manner. This integration is crucial for the [micro-frontend recommended solution](https://docs.sentry.io/platforms/javascript/best-practices/micro-frontends/#automatically-route-errors-to-different-projects-depending-on-module).
…13822) This PR fixes #13803. The corresponding PR for latest major version is #13817. I saw the bundles generation for integration is happening in `@sentry/integrations`, so I added a corresponding file for `modulemetadata` in this package that exports that integration from `@sentry/core`, so that the bundle actually gets created for this integration as needed.
I merged both PRs, thank you for opening them! We'll include these in the next releases. |
Thank you so much for all the help! |
We'll try to cut a release in the near future, can't give a concrete ETA but hopefully should not be too long! |
A PR closing this issue has just been released 🚀This issue was referenced by PR #13817, which was included in the 8.38.0 release. |
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
to7.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
The text was updated successfully, but these errors were encountered: