Skip to content

Conversation

@cexbrayat
Copy link
Member

Fixes#1829

I'm not super convinced by this fix, but it indeed looks like @freakzlike intuition is right: we need to return the children as a function for Teleport to avoid the warning.

Maybe @xanf you have a better idea on how to handle that?

@cexbrayatcexbrayat requested a review from xanfOctober 26, 2022 15:11
@netlify
Copy link

netlifybot commented Oct 26, 2022

Deploy Preview for vue-test-utils-docs ready!

NameLink
🔨 Latest commit60268e6
🔍 Latest deploy loghttps://app.netlify.com/sites/vue-test-utils-docs/deploys/635a870bdabf1f0008818af0
😎 Deploy Previewhttps://deploy-preview-1833--vue-test-utils-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Collaborator

@freakzlikefreakzlike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no better solution for this.
Can you add a spy on console.warn on one of the teleport tests?

@cexbrayatcexbrayatforce-pushed the fix/1829-teleport-children-as-a-function branch from 4bb8fd8 to 250610cCompareOctober 27, 2022 13:21
@cexbrayat
Copy link
MemberAuthor

@freakzlike I added a test to check that the warning is not logged anymore, and added a check in other tests when it is logged, but when that we expect it.

Maybe we should do the same for the warnings logged by vue compact (either mock them or fix them if needed) to avoid polluting the test logs, and missing a regression like this one in the future

Anyway, this should fix the issue, unless someone comes up with a better idea. I'll let you give a last check and merge

@cexbrayatcexbrayatforce-pushed the fix/1829-teleport-children-as-a-function branch from 250610c to 60268e6CompareOctober 27, 2022 13:26
@lmiller1990
Copy link
Member

lmiller1990 commented Oct 27, 2022

This does feel like a bit of a hack, but okay for now. I am not sure of a better way.

Warnings are not much fun. let's merge this up with one more ✅ and release.

@lmiller1990lmiller1990 self-requested a review October 27, 2022 13:41
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: [Vue warn] Non-function value encountered for default slot on stubbed teleport

3 participants

@cexbrayat@lmiller1990@freakzlike