Subscribe on changes!

<script setup> used alongside Options API can break ref in production mode

avatar
Jul 8th 2022

Vue version

3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#eNp9UNtOwzAM/ZXITyCtibQhIZUOjf/IS2k9Wlguip0Nqeq/k6wFuk2an+Jz8XE8wJv38hgRStC2YjT+UDO+aitSVb31kUXA/VYDYR2aToNQia3UQppaakLvWRBy9LO5cZZYnLqkOWIQW/G0fsnGSbq0zQb89i6waHFfxwOLYUJzGeTOtVQusVzTSg+PYhhX/8zve7yMgxX0JicUpvbyk5xNfz4P1DNBGv4iNKSj5F5Dx+ypVCpa//UhG2fULnEqRMu9waJ1ZreRa7l5Vm1PvMQlkinegzsRhpSoYd7sPFwlMB2mCGhbDBjuhl1pLwKvuJvQnDlqO8L4Awhro+k=

Steps to reproduce

No additional steps required.

What is expected?

Input to be displayed and no error.

What is actually happening?

ReferenceError: search is not defined

System Info

No response

Any additional comments?

The error occurs only when the ref is named like one of the component's variables/methods. The error occurs only in production mode. There is no error if there is nothing in the