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

vue render error when there is comment node and keep-alive and dynamic component #2134

Closed
lovetingyuan opened this issue Sep 16, 2020 · 4 comments

Comments

@lovetingyuan
Copy link

Version

3.0.0-rc.11

Reproduction link

https://codesandbox.io/s/github/lovetingyuan/vue3-comment-render-bug

Steps to reproduce

github: https://github.com/lovetingyuan/vue3-comment-render-bug
1 use vite to serve the website
2 click button: show list
3 click first item

What is expected?

There should no errors.

What is actually happening?

vue.js:1166 [Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next 
  at <KeepAlive> 
  at <App>
warn @ vue.js:1166
logError @ vue.js:1339
handleError @ vue.js:1331
callWithErrorHandling @ vue.js:1285
flushJobs @ vue.js:1487
flushJobs @ vue.js:1500
Promise.then (async)
queueFlush @ vue.js:1387
queueCb @ vue.js:1409
queuePostFlushCb @ vue.js:1415
queueEffectWithSuspense @ vue.js:2458
scheduler @ vue.js:6425
run @ vue.js:479
trigger @ vue.js:485
set @ vue.js:578
showContent @ C:\Users\vue3-comment-render-bug\components\ListComp.vue:22
_createBlock.onClick._cache.<computed>._cache.<computed> @ C:\Users\vue3-comment-render-bug\components\ListComp.vue:3
callWithErrorHandling @ vue.js:1282
callWithAsyncErrorHandling @ vue.js:1291
invoker @ vue.js:8003
vue.js:7722 Uncaught (in promise) TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node'.
    at insert (vue.js:7722)
    at move (vue.js:6014)
    at move (vue.js:5976)
    at move (vue.js:5962)
    at Object.sharedContext.deactivate (vue.js:4034)
    at unmount (vue.js:6024)
    at patch (vue.js:5070)
    at componentEffect (vue.js:5665)
    at Object.reactiveEffect [as update] (vue.js:343)
    at updateComponent (vue.js:5549)
@lovetingyuan lovetingyuan changed the title vue render error when there is comment node vue render error when there is comment node and keep-alive and dynamic component Sep 16, 2020
@lovetingyuan
Copy link
Author

I am not sure about the reason. But if I remove keep-alive or remove the comment node in ListComp.vue, there is no render error.

@lovetingyuan
Copy link
Author

Excuse me, but I found the bug still occurs when built in production mode.

Run yarn build and use dist as http server root dir. The issue mentioned above is still there.

index.5a30f16e.js:1 TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node'.
    at insert (index.5a30f16e.js:1)
    at Z (index.5a30f16e.js:1)
    at Z (index.5a30f16e.js:1)
    at Z (index.5a30f16e.js:1)
    at Object.i.deactivate (index.5a30f16e.js:1)
    at Q (index.5a30f16e.js:1)
    at w (index.5a30f16e.js:1)
    at index.5a30f16e.js:1
    at Object.n [as update] (index.5a30f16e.js:1)
    at L (index.5a30f16e.js:1)
{
  "dependencies": {
    "vue": "3.0.0"
  },
  "devDependencies": {
    "@vue/compiler-sfc": "3.0.0",
    "vite": "1.0.0-rc.4"
  }
}

@yyx990803 Could you check it? Thanks a lot.

@LinusBorg LinusBorg reopened this Sep 19, 2020
@underfin
Copy link
Member

underfin commented Sep 22, 2020

#2134 (comment) caused by use @compiler-core dev bundler compiler template with production. vitejs/vite#732 is already fixed this.

@lovetingyuan
Copy link
Author

Yep, I use cross-env NODE_ENV=production vite build, and it works well. So it is not a vue's bug, right? If so, please feel free to close this issue. Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants