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

'cur' attr is undefined in removeFragment function #5317

Closed
flancer64 opened this issue Jan 24, 2022 · 1 comment
Closed

'cur' attr is undefined in removeFragment function #5317

flancer64 opened this issue Jan 24, 2022 · 1 comment

Comments

@flancer64
Copy link

Version

3.2.28

Reproduction link

duplo.pilot.teqfw.com/

Steps to reproduce

I have an error message when clean storage ("DevTools / Application / Storage" tab in Chrome browser) while my Progressive Web App is running. Goto link https://duplo.pilot.teqfw.com/#/hollow/occupy and wait for application will be fully loaded (about 10-15 sec), you should see the message "This hollow is occupied by some squirrel.". Then goto DevTools and clear the site data. The following error should be thrown:

TypeError: Cannot read properties of null (reading 'nextSibling')
    at nextSibling (vue.global.js:9156:33)
    at removeFragment (vue.global.js:7018:22)
    at remove (vue.global.js:6984:15)
    at unmount (vue.global.js:6968:19)
    at unmountComponent (vue.global.js:7040:15)
    at unmount (vue.global.js:6941:15)
    at patch (vue.global.js:5916:15)
    at render (vue.global.js:7088:15)
    at mount (vue.global.js:5371:27)
    at Object.app.mount (vue.global.js:10660:25)

This is a screenshot:
screenshot

What is expected?

I expect that removeFragment function will correctly handle case where cur attribute will stay undefined or null.

What is actually happening?

I have an error: "Cannot read properties of null (reading 'nextSibling')"


I suppose additional validation can help in this case (flancer64@431271c):

const removeFragment = (cur: RendererNode, end: RendererNode) => {
    ...
    while ((cur !== end) && cur) {
        ...
    }
    ...
}

I cannot create PR cause it's too complex for me to fix the error by right way. So it is just a bur report.

Thanks for the great framework, guys!

@posva
Copy link
Member

posva commented Feb 9, 2022

Your reproduction is not minimal, please read and follow https://new-issue.vuejs.org/?repo=vuejs/vue-next#why-repro when reporting a bug. Most bugs should be reproducible with the SFC Playground.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants