script setup: ref imported from a .vue file doesn't work after build
Version
3.0.4
Reproduction link
https://github.com/stephanedemotte/_issue-vue3-script-setup
Steps to reproduce
Create a fresh vitejs app
helloworld.vue
<template>
<div>
HelloWorld [{{ isActiveTpl }}]
</div>
</template>
<script>
import { ref } from 'vue'
export const isActive = ref(false)
</script>
<script setup>
const isActiveTpl = isActive
</script>
app.vue
<template>
<div>
App [{{ isActive }}]
</div>
</template>
<script setup>
import { isActive } from './components/HelloWorld.vue'
</script>
What is expected?
the value should be: true / false
What is actually happening?
After build the ref variable output a weird value
If i try to do isActive = !isActive
on app.vue, i've got no error on dev, but got Error: Illegal reassignment to import 'isActive'
when i try to build
Builded link http://test-vue-export.gaidaandsteph.com/
But wasn't 085bbd5fe07c52056e9f7151fbaed8f6a2e442b3 included in v3.0.4? The problem here only appears after bundling for prod
@CHOYSEN It's crazy you don't have
{ "_rawValue": false, "_shallow": false, "__v_isRef": true, "_value": false }
After the build ?
I cannot believe it :/ Can you share a screen please ?
I've tried again from scratch, and i've got the same result
App [{{ isActive }}]
should return App[true]
but got App [{ "_rawValue": false, "_shallow": false, "__v_isRef": true, "_value": false }]