Skip to content

<script setup> not working on root component in production build #6282

@raukaute

Description

@raukaute

Version

4.5.11

Environment info

System:
    OS: Windows 10 10.0.19041
    CPU: (4) x64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
  Binaries:
    Node: 15.7.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 7.4.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.423.0), Chromium (88.0.705.68)
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

Create new project with vue create testing (select vue3)

In App.vue change <script></script> block to

<script setup>
/* eslint-disable */
import HelloWorld from "./components/HelloWorld.vue";
</script>

works:
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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions