Subscribe on changes!

The default value of defineModel is not ssr friendly

avatar
Feb 9th 2024

Vue version

3.4.18

Link to minimal reproduction

https://play.vuejs.org/#__SSR__eNqNUttu1DAQ/RVjIQWkTdxleUBRWhVQJUDcBEi8+KFpMrtxiS+yJ7tbRfl3Jk67pAtUffNczpwzZ9zz185l2w54zotQeeWQBcDOnUmjtLMeWc9qWCsDn2wNLRvY2lvNEoIk0khTWROQ6bBhp/O+ZxFVdi3mLHkHbWvZT+vb+knChud3qJ2qsTnCJTGZLCbaacCLk5OIKsSkkLRRgKBdWyJQxFjRLFke8KaFU8l7pku/UeYjrAl9+bSPMwe3v2SD5Gc91UnvMBSiWU5oZVyHbJvqUQNNiADJGd64caDp9BV4igW1F2LGzBd8sinVpcuugzVkZD/OlLeFIHnOYmbMkW1jLHmD6EIuRFUbghGr2vrMAArjtDinNuE7g0pDWlt9vspeZstXolYB5/kMgk6vvN0F8DRF8sWMR1ByCz71YGrwo/zH8R7B7nEf1f7iH+kHaQayBQMdea02R6ZUVjvVgv/iUNEnuGdOSd9k9yHm0HdwWKZqoPr1j/x12E9LffUQlc0MQPoBgFP54vtn2NP7UKQzd+3tIf5T/AbBtt2ocWp705maZM/6otr38cbKbH6Eiz2CCXdLjUKjG7E/HuTtA6v/kbvKVgcXh9+1OzmA

Steps to reproduce

You can get this error just using defineModel inside any component and using its default value. Both if it is used inside a tag style or you just print it as plain text, you will get a hydration error. Ssr must be enabled

What is expected?

The default value should be also set server side

What is actually happening?

The default value is not set server side

System Info

No response

Any additional comments?

No response

avatar
Feb 10th 2024

Looks like a duplicate of #10209。