[TypeScript] Imported refs can't be used as template refs in development
Vue version
3.2.39 (but also reproducible in latest as the time of writing, 3.2.45)
Link to minimal reproduction
Steps to reproduce
Open the browser's console. In every step, check how the message elementRef value changed
from the watcher in test.ts
is displayed
- Change between production and development. You will see that it works as expected and the message is still displayed when reloading the page
- Add
lang="ts"
to the<script setup>
tag. - Change between dev and production. Production works without any problem, but development doesn't.
The same behaviour is reproducible across both mentioned Vue versions.
What is expected?
Refs imported from other modules should be binded to template refs
What is actually happening?
The ref is not binded to the template one in development when using lang=ts
.
System Info
No response
Any additional comments?
As @jacekkarczmarczyk pointed out:
Without lang it generates:
const __returned__ = { get elementRef() { return elementRef } }
With lang:
const __returned__ = { }