Subscribe on changes!

ref is undefined when script setup with threejs in production mode

avatar
Feb 8th 2021

Version

3.0.5

Reproduction link

https://github.com/huxianc/vue3-setup

Steps to reproduce

In devlopment mode,everything is normal. In production mode,ref is undefined when using Threejs

  1. yarn build
  2. serve -s dist

What is expected?

Ref should be a dom.

What is actually happening?

Ref is undefined.

avatar
Feb 8th 2021

dev mode: dev production mode: production

avatar
Feb 8th 2021

Are you sure the code you provided can reproduce the problem? I still can’t reproduce it using the demo you provided. I get the same result in dev/prod mode.

avatar
Feb 9th 2021

I cloned from my git repository, yarn and yarn build ,eveything was normal. Then I deleted node_modules in my local file, yarn and yarn build,got the same result. I should have checked more,sorry for opened this issue.