-
-
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
Unable to use @sentry/react v8 in module federated React app. #14017
Comments
Hey @MegaDhakse2 this rather looks like a webpack error for module federation. The only thing I spotted here is that you have set a required version |
I have this same issue and I am not using @sentry/react, but instead am just using @sentry/browser. I get: No version specified and unable to automatically determine one. No version in description file (usually package.json). Add version to description file C:\Projects\myProject\node_modules\@sentry\browser\build\npm\esm\package.json, or manually specify version in shared config. |
Sorry the version i specified was a typo.. my mistake.. I have changed it to 8.34.0 . |
Hi, can you please raise this with the Module Federation project? I don't think we are doing anything wrong in the SDK. |
Hi Mr. @lforst this issue was fixed in the version @sentry@8.35.0-beta.0 Exact commit is here: 5127bb7 This new beta version is working fine in module federation react apps also. I will close this issue once the version released officially without beta tag. |
Finally we got this issue fixed in the newly released minor version @sentry/react@8.35.0. |
I confirmed that this is working for me. Thank you! |
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/react
SDK Version
8.34.0
Framework Version
React 18.3.1
Link to Sentry event
No response
Reproduction Example/SDK Setup
Here,
I have three react apps namely AuthApp, ProfileApp & DashApp, where all routes are serving from AuthApp and sentry is also configured in AuthApp.. Those remaining apps ProfileApp & DashApp getting from module federation. That's the problem here. If i disabled those module federation connected apps, it works fine. If i included it getting the below warning
Connecting other react apps using Module Federation Configuration:
In webpack config file:
Steps to Reproduce
Step1: Create two or more react dummy apps.
Step2: Connect all three apps using Module Federation in webpack config file as above.
const { ModuleFederationPlugin } = require("webpack").container;
Step3: Make one app as main and serve your react routes from there.
Step4: Finally integrate the @sentry/react@8.34.0 to the main app where all the routes are serving.
Step5: If you did the above steps correctly, you will notice a waring in the UI.. All works fine the errors are catching by it, getting email and displaying in account issues dashboard.. But getting warning on the SCREEN which we can't move further.
Step6: Disabling that modully connected apps all works fine without the error.
Expected Result
Need to avoid the below warning in react module federation connected apps, like how it works in standalone react apps.
Disabling that modully connected apps all works fine without the error. But i need use sentry/react in module federation apps also without any errors.
Actual Result
need use sentry/react in module federation apps also without any errors.
The text was updated successfully, but these errors were encountered: