vuejs / core

đź–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Home Page:https://vuejs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

template ref with reactive in v-for always empty in production mode

Filin3 opened this issue · comments

Vue version

3.4.21

Link to minimal reproduction

https://play.vuejs.org/#eNp9kF9LwzAUxb/KJS/rYLZOfRrdQGUPCv5BfTMipb2t2dokJGmtlH53b1pW9yCjFMK5v5ycezp2rXXY1MhWLHZY6TJxuOESIM5EA81ZrsyaMwFCwvKcM1jt8ccLnA0UcRoM5iRpkroOBPR9HOnRIyITOsXRkbX/YpsaoR1YdLVHRaWVcdCBkg+qlg6zBbkmqRMNQg+5URXMKOWMy1RJ60DDegKC94+5N53uBsEc1hvofASPqxLDUhWBJqynP47G5zdswZwlIhdFuLNKUgnDJc5SVWlRonnSTpADZ6vRzs+SslTf94PmTI2Lg55+Ybr/R9/Z1mucPRu0aBrkbJq5xBToxvH29RFbOk/DSmV1SfSJ4QvSdrXPOGI3tcwo9hE3pL0b+hWyeLPb1qG0h6V8UE/2A88ZdXx7YvW/uJfh1XCPGqUWPxs03pMKpEF4sWT9Ly2kxOo=

Steps to reproduce

Open vue playground then open devtools console and change prod\dev mode

What is expected?

The same behavior is expected in prod and dev mode. Reactive const will be filled in both cases

What is actually happening?

The Reactive constant is filled in dev mode, but always empty in prod

System Info

No response

Any additional comments?

No response

The production behaviour is correct as the template ref gets a new array reassigned - and const variables are not re-assignable.

However we should look into how to warn about this in dev mode