Description
Version 30.0.0 is the last version that supports Vue 2, but it has a bug where tapAsync with an async callback never calls the completion callback, causing webpack-dev-server to hang at "wait until bundle finished".
This issue was already fixed in PR #907 for the main branch by changing tapAsync to tapPromise, but since there is no branch backup for v30.0.0, the fix cannot be backported via a PR.
The Fix
In src/core/unplugin.ts, the following change is needed:
- compiler.hooks.watchRun.tapAsync(PLUGIN_NAME, async () => {
+ compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => {
Full context from the main branch fix:
// src/core/unplugin.ts
webpack(compiler) {
let watcher: Watching
let fileDepQueue: { path: string, type: 'unlink' | 'add' }[] = []
- compiler.hooks.watchRun.tapAsync(PLUGIN_NAME, async () => {
+ compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => {
// ensure watcher is ready(supported since webpack@5.0.0-rc.1)
if (!watcher && compiler.watching) {
watcher = compiler.watching
Steps to Reproduce
- Use unplugin-vue-components@30.0.0 with webpack-dev-server
- Start dev server
- Make a file change to trigger a rebuild
- webpack-dev-server hangs with "wait until bundle finished"
Expected Behavior
The dev server should rebuild and reload normally.
Why an Issue instead of a PR
Version 30.0.0 does not have a corresponding branch in the repository, so a direct PR cannot be created against it. I'm hoping the maintainers can either:
- Create a
v30 branch and I can submit a PR against it, or
- Apply this one-line fix and publish a
30.0.1 patch release
Linked Issues/PRs
Description
Version 30.0.0 is the last version that supports Vue 2, but it has a bug where
tapAsyncwith an async callback never calls the completion callback, causing webpack-dev-server to hang at "wait until bundle finished".This issue was already fixed in PR #907 for the main branch by changing
tapAsynctotapPromise, but since there is no branch backup for v30.0.0, the fix cannot be backported via a PR.The Fix
In
src/core/unplugin.ts, the following change is needed:Full context from the main branch fix:
// src/core/unplugin.ts webpack(compiler) { let watcher: Watching let fileDepQueue: { path: string, type: 'unlink' | 'add' }[] = [] - compiler.hooks.watchRun.tapAsync(PLUGIN_NAME, async () => { + compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => { // ensure watcher is ready(supported since webpack@5.0.0-rc.1) if (!watcher && compiler.watching) { watcher = compiler.watchingSteps to Reproduce
Expected Behavior
The dev server should rebuild and reload normally.
Why an Issue instead of a PR
Version 30.0.0 does not have a corresponding branch in the repository, so a direct PR cannot be created against it. I'm hoping the maintainers can either:
v30branch and I can submit a PR against it, or30.0.1patch releaseLinked Issues/PRs