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.

500 _unref is not defined

See original GitHub issue

Environment


  • Operating System: Linux
  • Node Version: v16.16.0
  • Nuxt Version: 3.0.0-rc.8
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: typescript, srcDir, dir
  • Runtime Modules: -
  • Build Modules: -

Reproduction

image

Describe the bug

When using a computed propeties in a component, I get the error “500 _unref is not defined” when running yarn build, yarn preview.

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
danielroecommented, Aug 15, 2022

@antfu do you think this might be an auto-import issue?

Reproduction: https://stackblitz.com/edit/github-eevswz

2reactions
stanislavpodoliacommented, Aug 15, 2022

Same problem for me, any v-bind in css causes this. Nuxt Version: 3.0.0-rc.8

<script setup lang="ts">
const mixMode = computed(() => useState('mixMode', () => 'none').value);
</script>
<style lang="scss">
header {
  mix-blend-mode: v-bind(mixMode);
}
</style>

Runs fine in dev mode, but proper build gives “500 _unref is not defined” When compiled code looks like this

const _cssVars = { style: {
        "--281e1430": _unref(mixMode)
      } };

And _unref is never imported and this is the only place it appears, replacing with vue_cjs_prod.unref fixes the problem I can provide stripped down project I’m working on if it’s hard to reproduce, but looks like it happens with any v-bind. Also tried with plain css instead of scss - same problem

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 >
Vue3.x 出现_ unref is not defined 错误 - CSDN博客
Vue3.x 出现_unref is not defined 错误;vue3 ref is not defined.
Read more >
A Comprehensive Guide To Error Handling In Node.js
If an error occurs in the course of the asynchronous operation, it will be available via the err argument and result will be...
Read more >
Timers in Node.js
If there is a Timeout object scheduled using a set function, unref() can be called on that object. This will change the behavior...
Read more >
Timer Mocks - Jest
At this point in time, the callback should not have been called yet expect(callback).not.toBeCalled(); // Fast-forward until all timers have ...
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