fix(Carousel): resolve plugins with page transitions#4380
Merged
benjamincanac merged 8 commits intonuxt:v3from Jun 30, 2025
mikenewbon:fix/carousel-fade-page-transitions
Merged
fix(Carousel): resolve plugins with page transitions#4380benjamincanac merged 8 commits intonuxt:v3from mikenewbon:fix/carousel-fade-page-transitions
benjamincanac merged 8 commits intonuxt:v3from
mikenewbon:fix/carousel-fade-page-transitions
Conversation
commit: |
Contributor
Author
|
Just want to say, what a cool project to contribute to! It's my first time here and I'm a little worried my solution is a bandaid and I should have followed the breadcrumbs further back - but I really appreciate this pipeline that lets me install the built package on my project. Hope I can contribute further in the future. |
Member
benjamincanac
left a comment
There was a problem hiding this comment.
I understand the issue with computedAsync which would be enough to solve with a function instead but what's the point of retrying? 🤔
Contributor
Author
|
@benjamincanac I shouldnt make commits at 4am, I've cleaned up a little, hope thats better! |
- Replace computedAsync with manual plugin loading using ref + watch - Add retry logic with exponential backoff for dynamic import failures - Fix fade transitions breaking after page navigation with pageTransition enabled - Maintain all existing plugin functionality while improving reliability Fixes issue where carousel fade property stopped working after page navigation when page transitions were configured in Nuxt applications.
Remove unnecessary retry logic and error handling complexity. Replace computedAsync with simple async function approach as suggested by Nuxt team. Maintains the core fix for fade plugin breaking after page transitions.
Remove unnecessary plugin prop watcher and consolidate onMounted calls. The existing options/plugins watcher handles reinitialization correctly.
Remove intermediate pluginList variable and push directly to plugins.value.
The direct plugins.value.push() approach broke the fade functionality. Restore the pluginList approach that properly fixes the page transition bug.
benjamincanac
approved these changes
Jun 30, 2025
Member
benjamincanac
left a comment
There was a problem hiding this comment.
I've removed the loadPlugins call from onMounted since it was called twice with the immediate watch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue where carousel fade property stopped working after page navigation when page transitions were configured in Nuxt applications.
🔗 Linked issue
Resolves #4379
❓ Type of change
📚 Description
The Nuxt UI Carousel component's
fadeproperty would stop working after page navigation whenpageTransitionwas enabled in Nuxt applications. This bug manifested as:This issue only occurred when both conditions were met:
fadeprop enableddefinePageMeta({ pageTransition: ... })Root Cause Analysis
The bug was caused by VueUse's
computedAsyncfailing during page transitions in Nuxt:computedAsyncto dynamically import Embla Carousel plugins (includingembla-carousel-fade)computedAsync's dynamic imports would fail silentlyplugins.valueto become an empty arrayTechnical Solution
Replaced the unreliable
computedAsyncapproach with a robust manual implementation:Before (Problematic):
After (Fixed):
📝 Checklist