Skip to content
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(mergeConfig): don't recreate server.hmr.server instance #17763

Merged
merged 1 commit into from
Jul 30, 2024
Merged

fix(mergeConfig): don't recreate server.hmr.server instance #17763

merged 1 commit into from
Jul 30, 2024

Conversation

Vija02
Copy link
Contributor

@Vija02 Vija02 commented Jul 25, 2024

Description

Currently, the mergeConfig function recursively goes through objects and overrides them. This works for the most part, except for the server.hmr.server property which is a Server class/object.

The problem is that the mergeConfig function treats it like a normal JS object and effectively clones it. This turns it into a standard object which doesn't work. And it also breaks reference to the object.

We either need to modify the isObject function to check for classes, or for now, I've added an if statement to handle the special case, following the other precedence.

Copy link

stackblitz bot commented Jul 25, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think it's fine to keep it simple and handle this specific case for now. We can revisit checking classes next time.

@patak-dev patak-dev merged commit 5c55b29 into vitejs:main Jul 30, 2024
11 checks passed
@patak-dev patak-dev added the p3-minor-bug An edge case that only affects very specific usage (priority) label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants