question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

⚠️ 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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
yyx990803commented, Jan 23, 2021

I think it should be fixed by 4c4d629.

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

0reactions
anncwbcommented, Jan 26, 2021

@yyx990803 I have updated github. You can pull again. It’s amazing that I’ve tried a lot of this error. The error will only appear when the following dependencies are included. Delete one of them and the error will disappear. I don’t know if this error is vite fault

image

"dependencies": {
    "@iconify/iconify": "^2.0.0-rc.6",
    "@vueuse/core": "^4.0.10",
    "ant-design-vue": "2.0.0-rc.9",
    "apexcharts": "^3.23.1",
    "axios": "^0.21.1",
    "crypto-es": "^1.2.6",
    "echarts": "^4.9.0",
    "lodash-es": "^4.17.20",
    "vue": "^3.0.5"
  },
Read more comments on GitHub >

github_iconTop Results From Across the Web

"ReferenceError: _unref is not defined" - Stack Overflow
I'm creating a website (still a work in progress), which is currently hosted on Netlify at the following link: ChillingConCarne.
Read more >
Reactivity API: Core - Vue.js
ref() #. Takes an inner value and returns a reactive and mutable ref object, which has a single property .value that points to...
Read more >
[RANT] How Vue 3 drove me away : r/vuejs - Reddit
The problem Vuex solved for Vue 2 is solved by the composition API. ... Magic behaviors like unref-ing automatically at the template level...
Read more >
Juggling Vue.js Refs - Abdelrahman's Blog
Luckily Vue exports an unref function that makes this a breeze. ... But that's the problem, for the reactive value to be passed...
Read more >
Guidelines | VueUse
Here are the guidelines for VueUse functions. ... data = shallowRef<T | undefined>() const error = shallowRef<Error | undefined>() fetch(unref(url)) .then(r ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found