Skip to content

fix: fix injection symbol(clientData) failure caused by HMR, close #1715#1716

Open
pengzhanbo wants to merge 1 commit into
vuepress:mainfrom
pengzhanbo:fix-1715
Open

fix: fix injection symbol(clientData) failure caused by HMR, close #1715#1716
pengzhanbo wants to merge 1 commit into
vuepress:mainfrom
pengzhanbo:fix-1715

Conversation

@pengzhanbo

@pengzhanbo pengzhanbo commented Jul 21, 2026

Copy link
Copy Markdown
Member

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Provide a description in this PR that addresses what the PR is solving. If this PR is going to solve an existing issue, please reference the issue (e.g. close #123).

What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Documentation update
  • Other

Description

resolve #1715.

From a shallow analysis, this is a bug caused by the module-level constant symbol('clientData') being replaced with a new constant during hot updates.

This PR can fix the issue.

However, the deeper reason is that every time markdown is updated, two import.meta.hot.accept callbacks are triggered. In these callbacks, the component chunk returns a new object (a new component) each time, and one is asynchronous while the other is synchronous:

  1. Vue plugin callback: executes reload or rerender
  2. Vuepress callback: executes updatePageData

Internally, there is a race condition rewriting of the hot-updated components between these two, and the problem may have started from this point.

Regarding the hot-update issue from markdown to Vue, I believe it is necessary to rewrite it appropriately to fundamentally solve such problems.

Screenshots

Before

After

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug report] Importing local components in a markdown file throws an error during HMR

1 participant