Skip to content
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

fix(vite): dedupe vue to only use one version of it #6024

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Jul 10, 2024

When building locally against linked nextcloud-vue, custom reference widgets didn't load since we migrated to vite as builder and module bundler.

Apparently this was because webpack before didn't use modules but vite now does. So apparently the two vue dependencies from nextcloud-vue and text are suddenly treated as separate modules and have separate states.

Adding vue to resolve.dedupe in the vite config solves, as it forces vite to only use vue from the root project (text).

Fixes: #5958

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits

When building locally against linked nextcloud-vue, custom reference
widgets didn't load since we migrated to vite as builder and module
bundler.

Apparently this was because webpack before didn't use modules but vite
now does. So apparently the two vue dependencies from nextcloud-vue and
text are suddenly treated as separate modules and have separate states.

Adding `vue` to `resolve.dedupe` in the vite config solves, as it forces
vite to only use vue from the root project (text).

Fixes: #5958

Signed-off-by: Jonas <jonas@freesources.org>
Copy link
Member

@juliushaertl juliushaertl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@mejo- mejo- merged commit 3a436e0 into main Jul 10, 2024
59 of 61 checks passed
@mejo- mejo- deleted the fix/vite_dedupe_vue branch July 10, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Custom reference widgets (link previews) broken
2 participants