Subscribe on changes!

[Vue warn]: injection "Symbol(ssrContext)" not found.

avatar
Dec 22nd 2022

Vue version

3.2.45

Link to minimal reproduction

https://sfc.vuejs.org/#__SSR__eNqNVMGO0zAQ/ZVRLu3utkn3GtICAglxQCCEOOXippPirmMb2+mCovw7YztJ0y5CnBKPZ+Y9v/Fzl7zVOj23mORJYSvDtQOLrtUgmDxuy8TZMtmVkjdaGQcdfFIHJr4YpS30UBvVwCLNPgi1Z2Lxasp7pxo97fqFh1jM2hhkleNnnJr4faovJUClpHWgmXkvjvkccDuVLTufCND4ze8cn3OombC4imHHncAcFg6tWwwxg/VNpFKtdDlswrK/I3SAC77PDNgEu7yD7Q4GzEgsDdXbTajqA/MiiwKSXLRw2GjBHNIKoNi3zikJbyrBqycv69id1DVIihdZTInpQb/zmo6HIj8IP4gIS+ldN2fQ90VWUTbVFdmEmaySKPW6YTo9WSVpvoF/OWzQWPPxRGVC6vt1mfxwTts8y2xd+ZGdbKrMMaO/1BAYbzBF26z3Rj1bNNS4TAYxQ4+Mgmc0a4PygAbNv3repL7oG3QtZU9HGS+Qv6PXsh74GXKaLOlDKqX0F26rJwTQdT42qDQGCyuU29Go/Cf0yKjJtXphfoMZZjaIxghF/2uHWaZTX7G2KzhgzSWGkhX4z7ff+q82yO7vA+l70D45/mczgwyemDUcbUHnnoZLbiCAHD7vT1g5YHYCLS7kd8MUvU1+ttzgIQdn2tFP/cUi18wEl090Mm+ulwSJBdGL514GtimFRp+dmSGfNmgoh4T9KB1dCCaWdSvJ4uQVMl04wjTElLZbhIctPPoeHkQJTIU6LuP4oyXL5OGmJED2q8fNZjOiT16l6xXHlTpL9wt/hXFxz6ZmFc4HHNjMXpy9IngmQ8fhxbHOcHkMkfDezNaBz+scZNvs0VCoT/o/Q1TYhg==

Steps to reproduce

click button, check console.log

What is expected?

no warning

What is actually happening?

I use reactive + toRefs to create a two way data binding. My parent vnode do all the logic, child vnode exists only for dynamic comp rendering.

several questions:

When I send v-model as a complex data structure, everything's fine, except a warning as below, what does that mean? 4

I try to build a simple demo in SFC, the result is just as excepted, but also find something naughty. 5

Why VUE doesn't offically support two way data binding, even though we still have ways to bypass the rule? Are there any side effects to do that?

Also I wish we can change the template before Mounted, so we don't need to face the complexity between parent and children.

System Info

No response

Any additional comments?

No response

avatar
Dec 22nd 2022

Reproduction link doesn't reproduced described error, therefore we have no way of investigating this issue.

The effect in the screenshot is because you have SSR on and the simulated SSR Render is still running its timer. In a real world scenario you would not start a timer in setup on the server, hopefully.

Why VUE doesn't offically support two way data binding, even though we still have ways to bypass the rule? Are there any side effects to do that?

I don't get what you mean. Consider opening a thread in this repository's Discussion Tab.

avatar
Dec 22nd 2022

I have no idea why there's an SSR warning, I didn't use SSR at all. But I cannot reproduced in SFC. Use a timer is just for sample, I got it!

To simplify my question: Will that warning have any affects if I continue to try 2 way data binding, and go to production env.

avatar
Dec 22nd 2022

That warning is not related to "two way data binding" but it certainly is not something to ignore if it happens.

avatar
Dec 22nd 2022

After restart the computer, the warning is gone... But there's another one: 6

checkout my SFC demo, also removed v-model.

avatar
Dec 22nd 2022

7

avatar
Dec 22nd 2022

Just solved! should use dlg.modalVIew.value instead!!