vite: vue unref error

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)
  • If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.

Describe the bug

@yyx990803 I think there will be many such problems in this update

<script lang="ts">
  import { defineComponent, ref, unref } from 'vue';
  export default defineComponent({
    name: 'App',
    setup() {
      const count = ref(0);
      console.log(unref(count));
      return {};
    },
  });
</script>


Reproduction

git clone https://github.com/anncwb/vite-bug yarn && yarn serve

image

System Info

  • vite version:beta.41
  • Operating System:
  • Node version:
  • Package manager (npm/yarn/pnpm) and version:

Logs (Optional if provided reproduction)

  1. Run vite or vite build with the --debug flag.
  2. Provide the error log here.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (18 by maintainers)

Commits related to this issue

Most upvoted comments

I think it should be fixed by 4c4d629.

@ResuBaka @vue/server-renderer should be moved to devDependencies or excluded for optimization.