vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

Built lib returns warnings and not render anything when imported in a Vue-cli project #6294

Closed alexandreDavid closed 3 years ago

alexandreDavid commented 3 years ago

Version

5.0.0-alpha.4

Environment info

System:
OS: Linux 5.8 Ubuntu 20.10 (Groovy Gorilla)
CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
Binaries:
Node: 12.18.2 - /usr/bin/node
Yarn: 1.22.10 - ~/.npm-packages/bin/yarn
npm: 6.14.8 - /usr/bin/npm
Browsers:
Chrome: 88.0.4324.150
Firefox: 85.0.1 npmPackages:
@vue/babel-helper-vue-jsx-merge-props: 1.2.1
@vue/babel-helper-vue-transform-on: 1.0.2
@vue/babel-plugin-jsx: 1.0.3
@vue/babel-plugin-transform-vue-jsx: 1.2.1
@vue/babel-preset-app: 5.0.0-alpha.4
@vue/babel-preset-jsx: 1.2.4
@vue/babel-sugar-composition-api-inject-h: 1.2.1
@vue/babel-sugar-composition-api-render-instance: 1.2.4
@vue/babel-sugar-functional-vue: 1.2.2
@vue/babel-sugar-inject-h: 1.2.2
@vue/babel-sugar-v-model: 1.2.3
@vue/babel-sugar-v-on: 1.2.3
@vue/cli-overlay: 5.0.0-alpha.4
@vue/cli-plugin-babel: ~5.0.0-alpha.4 => 5.0.0-alpha.4
@vue/cli-plugin-eslint: ~5.0.0-alpha.4 => 5.0.0-alpha.4
@vue/cli-plugin-router: 5.0.0-alpha.4
@vue/cli-plugin-vuex: 5.0.0-alpha.4
@vue/cli-service: ~5.0.0-alpha.4 => 5.0.0-alpha.4
@vue/cli-shared-utils: 5.0.0-alpha.4
@vue/compiler-core: 3.0.5
@vue/compiler-dom: 3.0.5
@vue/compiler-sfc: ^3.0.4 => 3.0.5
@vue/compiler-ssr: 3.0.5
@vue/component-compiler-utils: 3.2.0
@vue/preload-webpack-plugin: 1.1.2
@vue/reactivity: 3.0.5
@vue/runtime-core: 3.0.5
@vue/runtime-dom: 3.0.5
@vue/shared: 3.0.5
@vue/web-component-wrapper: 1.3.0
eslint-plugin-vue: ^7.2.0 => 7.6.0
vue: ^3.0.4 => 3.0.5
vue-eslint-parser: 7.5.0
vue-hot-reload-api: 2.3.4
vue-loader: 16.1.2 (15.9.6)
vue-style-loader: 4.1.2
vue-template-es2015-compiler: 1.9.1
npmGlobalPackages:
@vue/cli: 5.0.0-alpha.4

Steps to reproduce

Building a vite app and defining the mode lib with the standards of the doc Building a vue-cli app with Vue3 presets Including the lib to the app

What is expected?

The lib components appear on the screen

What is actually happening?

Nothing appears, just some console warnings : runtime-core.esm-bundler.js?7572:38 [Vue warn]: resolveDirective can only be used in render() or setup().

runtime-core.esm-bundler.js?7572:38 [Vue warn]: withDirectives can only be used inside render functions.

[Vue warn]: Invalid VNode type: Symbol(Fragment) (symbol) at at


The lib works perfectly with a second Vite built project as App This lib depends on Primevue component framework. When I don't use it, it works everywhere. I tried with Vue-cli 4.5.11 and 5.x, same behaviour

haoqunjiang commented 3 years ago

Thanks for submitting this issue! Due to our limited time, we ask you to include a reproduction link to a minimal full reproduction of your problem (for example in a GitHub repository) so we can find what is causing the issue. Thank you for your understanding!

alexandreDavid commented 3 years ago

I found my issue, on my tests in local, I had a node_modules with my lib.