-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
fix(bridge-react): wrap react-router-dom path resolve with try catch #3232
Conversation
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
🦋 Changeset detectedLatest commit: 3aa965b The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
This pull request fixes a bug in the bridge-react
package by wrapping the react-router-dom
path resolution in a try-catch block. This change ensures more robust handling of routing-related functionality and prevents application crashes during the build process when there are issues with the react-router-dom
path resolution.
The key changes include:
- Wrap
react-router-dom
path resolution in a try-catch block in the following files:packages/bridge/bridge-react-webpack-plugin/src/utis.ts
packages/bridge/bridge-react/src/router-v5.tsx
packages/bridge/bridge-react/src/router-v6.tsx
packages/bridge/bridge-react/src/utils.ts
- Simplify the logic for determining the
reactRouterDomPath
variable inpackages/bridge/bridge-react-webpack-plugin/src/utis.ts
- Read the package.json content directly from the resolved path instead of relying on the
findPackageJson
function inpackages/bridge/bridge-react-webpack-plugin/src/utis.ts
These changes improve the overall reliability and robustness of the bridge-react
package by handling potential errors during the build process.
File Summaries
File | Summary |
---|---|
packages/bridge/bridge-react-webpack-plugin/src/utis.ts | The code changes wrap the react-router-dom path resolution in a try-catch block to handle potential errors, and simplify the logic for determining the reactRouterDomPath variable. Additionally, the code now reads the package.json content directly from the resolved path instead of relying on the findPackageJson function. |
packages/bridge/bridge-react/src/router-v5.tsx | The changes in this file involve wrapping the react-router-dom path resolution in a try-catch block to handle potential errors during the build process. This is a bug fix that addresses an issue where directly exporting from react-router-dom/index.js was causing build failures. |
packages/bridge/bridge-react/src/router-v6.tsx | The changes in this file focus on wrapping the react-router-dom path resolution within a try-catch block to handle potential errors. This is likely a bug fix to ensure more robust handling of routing-related functionality in the bridge-react package. |
packages/bridge/bridge-react/src/utils.ts | The changes in this file introduce a try-catch block around the react-router-dom path resolution logic to handle potential errors and prevent application crashes. This is a bug fix that enhances the reliability and robustness of the bridge-react package. |
Description
fix(bridge-react): wrap react-router-dom path resolve with try catch
Related Issue
Types of changes
Checklist