-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
External library components break in rollup build (Vue3) #4089
Comments
I've added the "dist" directories so that you don't have to build the repo. After a closer look, the Vue library seems to get duplicated in the final output vendor chunk. Both the imported component and the app's component use their own Vue functions and they don't seem to be aware of eachother (output). |
Alright, the problem seems to be the use of I strumbled upon this so thread, then this comment. While this doesn't specifically appear to be a Vite issue, it might be worth documenting somewhere to avoid hard-to-debug surprises. |
@tamasfe Please feel free to create a PR to update the docs vite/docs/guide/dep-pre-bundling.md Line 37 in d377aae
|
Describe the bug
Components imported from an external library stop working correctly after the final bundle is produced, even though
vite dev
loads them correctly.I created a library package according to the docs, and used an exported component in an another application.
Things seem to disappear or simply stop working, namely templates/fragments and slots.
Nodes either just don't render, or errors like
node is null
are thrown. The latter happens with slots, but I don't have a MWE for that.Reproduction
I created an example repo here.
steps:
testlib
yarn
yarn build
yarn link
if neededtestapp
yarn link testlib
if neededyarn
yarn dev
yarn build && yarn serve
System Info
Used Package Manager
yarn
Logs
Validations
The text was updated successfully, but these errors were encountered: