Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 _unref is not defined #14550

Closed
denisales opened this issue Aug 12, 2022 · 5 comments · Fixed by vuejs/core#6489
Closed

500 _unref is not defined #14550

denisales opened this issue Aug 12, 2022 · 5 comments · Fixed by vuejs/core#6489

Comments

@denisales
Copy link

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

Copy link
Member

Can you see what the line of code in the terminal is referring to? Would you provide a reproduction? 🙏

@stanislavpodolia
Copy link

stanislavpodolia commented 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

@danielroe
Copy link
Member

danielroe commented Aug 15, 2022

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

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

@antfu antfu self-assigned this Aug 15, 2022
@antfu
Copy link
Member

antfu commented Aug 17, 2022

This is an upstream @vitejs/plugin-vue bug. I am investigating and will send a fix.

@antfu
Copy link
Member

antfu commented Aug 17, 2022

Upstream PR: vuejs/core#6489

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants