vue-fragment icon indicating copy to clipboard operation
vue-fragment copied to clipboard

NotFoundError: Node was not found in removeChild.

Open douglasg14b opened this issue 6 years ago • 7 comments

I'm using a fragment with a slot, which seems to be the cause? The above error occurs every time I change router views while the below component is the root element for the routes component.

    <fragment>
        <v-expand-transition v-if="initSteps === 0" leave-absolute>
            <v-progress-linear v-show="showProgress" class="z-index-100" indeterminate absolute top></v-progress-linear>
        </v-expand-transition>
        <v-expand-transition v-else leave-absolute>
            <v-progress-linear v-show="showProgress" stream class="z-index-100" absolute top :value="initProgress"></v-progress-linear>
        </v-expand-transition>

        <slot></slot>

        <v-overlay :dark="false" absolute opacity="0.75" color="grey lighten-3" :value="showProgress" v-if="initSteps == 0">
        </v-overlay>
        <v-overlay :dark="false" absolute v-else opacity="0.5" color="grey lighten-3" :value="showProgress">
        </v-overlay>
    </fragment>

douglasg14b avatar Sep 19 '19 04:09 douglasg14b

I also met

Planck-Ho avatar Nov 25 '19 01:11 Planck-Ho

I also met

xiongxt avatar Dec 11 '19 08:12 xiongxt

?

douglasg14b avatar Dec 12 '19 04:12 douglasg14b

Try to use v-show instead of v-if on the root elements. Maybe this helps.

tobias-kuendig avatar Jan 23 '20 13:01 tobias-kuendig

My solution was to use a render function. I converted this

<template>
  <Fragment v-if="matches">
    <slot></slot>
  </Fragment>
</template>

to this

 render(createElement) {
    let { $slots, matches } = this;
    let children = matches ? $slots.default : undefined;

    return createElement(Fragment, {}, children);
  }

And now it works without problems

constgen avatar Mar 23 '20 16:03 constgen

Congrats you just converted

<template>
  <Fragment v-if="matches">
    <slot></slot>
  </Fragment>
</template>

To

<template>
  <Fragment>
    <slot v-if="matches"></slot>
  </Fragment>
</template>

Tofandel avatar Aug 04 '20 22:08 Tofandel

You are absolutely right

constgen avatar Aug 07 '20 20:08 constgen