-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
<script setup> not working on root component in production build #6282
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
Comments
me too |
一样的问题 |
Set // vue.config.js
module.exports = {
parallel: false
} It seems like That makes |
Downgrade from 3.0.11 to vue 3.0.0 and adding code above solved problem in my case. |
I have also encountered this issue, but not just for the root component (with all SFCs). I have not traced the cause, but a (verbose) workaround that has worked for me is to append a manual export of the In each SFC, append the following after the // Component.vue
<script setup>
...
</script>
<script>
export default {
setup() {
return
}
}
</script> Using Vue // package.json
{
"vue": "3.1.1",
"@vue/compiler-sfc": "3.1.1"
} I had actually noted that serving the production |
Just got stuck on this issue for hours, trying to reproduce it locally, where I usually only do development builds. I guess that is what you get for using experimental features 😞 The reason, it is so hard to pin-point, is that after a local development build the |
@XHalso: Your question seems offtopic. My guess would be, that the ref is only available after the component was mounted, not during setup(). If you have further question please come join us in discord! |
run:
can solve. |
this works for me. |
I think this issue is fixed since |
I can confirm that it was fixed for me, but the relevant commit is only included since |
work for [email protected] when using setup script. |
@sodatea its not working |
For anyone still having the issue. I am working with
I believe this is necessary because |
Version
4.5.11
Environment info
Steps to reproduce
Create new project with vue create testing (select vue3)
In App.vue change
<script></script>
block toworks:
Run:
npm run serve
-> Everything works as expected;does not work:
Run:
npm run build
Serve dist directory (e.g. http-server) -> nothing gets rendered
What is expected?
Render App
What is actually happening?
App does not get rendered
I somehow have the feeling, that this was working before. This is only happening on the root App component.
When I look the imported object, I don't see any render function.
Cheers!
The text was updated successfully, but these errors were encountered: