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

Slot throws warning when passed down to component and rerendered #3695

Closed
ilicmarko opened this issue Apr 29, 2021 · 6 comments · Fixed by #3698
Closed

Slot throws warning when passed down to component and rerendered #3695

ilicmarko opened this issue Apr 29, 2021 · 6 comments · Fixed by #3698
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working

Comments

@ilicmarko
Copy link

Version

3.0.11

Reproduction link

Gist with SFC Link

SFC Direct Link

Steps to reproduce

Create 3 components :

  1. GrandParent - should accept some data that re-renders a slot, for example, array of objects.
  2. Parent
  3. Child

GrandParent passes down all it's slots to the Parent component:

return h(Parent, { data: this.data }, this.$slots)

Parent component should render the slot inside the Child

h(Child, {} , {
 default: () => row.key
}))

In the root app (App.vue) call the GrandParent and add a slot

<GrandParent :data="data">
    <template #cell-hello>Test</template>
  </GrandParent>

Now asynchronously update the data array and Vue will throw a read-only warning for the given slot:

Set operation on key "cell-hello" failed: target is readonly. {__vInternal: 1, cell-hello: ƒ}

What is expected?

Not to throw a warning

What is actually happening?

Throwing a warning but everything works.


This started happening after updating to 3.0.11. AFAIK this is related to #3523 and started happening after this update.

@ilicmarko ilicmarko changed the title Slot target readonly when passed down to component Slot throws warning when passed down to component and rerendered Apr 29, 2021
@HcySunYang HcySunYang added 🐞 bug Something isn't working 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Apr 30, 2021
@ais-one
Copy link

ais-one commented May 13, 2021

Hi,

I think this should be escalated and not flagged as a P3-monor-bug...

vueComponent/ant-design-vue#3998 (comment)

The number of warnings increases as the number of components on the page increases...

@wenfangdu
Copy link

This is quite annoying, please fix this ASAP 🙏.

image

@arthur-0595

This comment has been minimized.

@HcySunYang HcySunYang added ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. and removed 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels May 23, 2021
@HcySunYang
Copy link
Member

Mark this as p4

@hzy-6

This comment has been minimized.

@white-007

This comment has been minimized.

yyx990803 pushed a commit that referenced this issue May 24, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working
Projects
None yet
7 participants