Subscribe on changes!

Reactivity Transform: Fails to transform $ref() when used on an export

avatar
Jan 20th 2022

Version

3.2.27

Reproduction link

sfc.vuejs.org/

Steps to reproduce

Check out the PLayground. it fails with $ref is not defined

The Test.ts file in the playground has instructions for a workaround, demonstrating the transform only fails when used on an export

What is expected?

$ref() is being transformed, and App.vue succeeds in importing and using the export.

What is actually happening?

$ref() is left in the code untransformed, leading to a ReferenceError at runtime.

Found by a user and reported here originally: https://github.com/vuejs/rfcs/discussions/369#discussioncomment-2009933

avatar
Jan 20th 2022

will also fail with a preceding label

some_label: 
var test=$ref(1)