fix: failed to resolve Rsbuild client modules#6674
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR fixes the resolution of Rsbuild client modules (hmr and overlay) when @rsbuild/core is not installed in the project root. Instead of using package imports like @rsbuild/core/client/hmr, the code now uses filesystem paths via the new CLIENT_PATH constant.
Key Changes
- Added
CLIENT_PATHconstant that resolves to the physical location of client modules in the dist folder - Updated HMR entry injection to use filesystem paths instead of package imports
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/constants.ts | Adds CLIENT_PATH constant pointing to client modules location |
| packages/core/src/server/assets-middleware/index.ts | Updates HMR entry generation to use CLIENT_PATH instead of package imports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary
Fix failed to resolve Rsbuild client modules if
@rsbuild/coreis not installed in the project root.Related Links
Checklist