Skip to content

Components exported from Vue.js 3 library cannot be used in application #6345

Open
@livthomas

Description

@livthomas

Version

4.5.11

Reproduction link

https://github.com/livthomas/vue-bug

Environment info

  System:
    OS: Linux 5.10 Manjaro Linux
    CPU: (16) x64 AMD Ryzen 7 PRO 4750U with Radeon Graphics
  Binaries:
    Node: 15.10.0 - /usr/bin/node
    Yarn: 1.22.10 - ~/.npm-global/bin/yarn
    npm: 7.6.1 - ~/.npm-global/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 86.0
  npmGlobalPackages:
    @vue/cli: 4.5.11

Steps to reproduce

  1. Install and build the library:
cd lib
npm install
npm run build
  1. Link library and start the application:
cd ../app
npm link ../lib
npm run serve
  1. Open the application running at http://localhost:8080/
  2. Notice missing content and warnings in the dev console

What is expected?

A component imported from the library should work without any problems in the application.

What is actually happening?

There is a warning saying [Vue warn]: Invalid VNode type: Symbol(Static) (symbol) and the component is not rendered properly. You can see that the mixin (defined in the same Vue.js plugin as the component) works properly but the component does not.


I'm trying to create a component library, export those components as a Vue.js plugin and then reuse it across multiple applications. By the way, when I import components directly (without plugin), I run into the same problem. I am not sure whether I miss something or there is some bug in Vue.js 3 (or Vue CLI) that nobody noticed yet.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions