Subscribe on changes!

reactive cannot define const in setup

avatar
Feb 2nd 2021

Version

3.0.5

Reproduction link

https://codesandbox.io/s/vigilant-glitter-4qpjn?file=/src/components/HelloWorld.vue

Steps to reproduce

What is expected?

can run it

What is actually happening?

[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next

error: Uncaught (in promise) TypeError: Cannot read property 'type' of undefined


if i change const to let let todoList:Array = reactive([]); demo can run it

avatar
Feb 2nd 2021

It works in a vite app and on a CLI app so it should be a bug on Codesandbox or a misconfiguration on the template.The setup syntax requires to use the compiler.