Skip to content
Discussion options

You must be logged in to vote

export default defineNuxtPlugin((nuxtApp) => {

const testSwiperError = ( error, instance, info ) => {
    return (
        error instanceof TypeError &&
        error.message?.includes("Cannot read properties of undefined (reading 'removeEventListener')") &&
        (error.stack?.includes("swiper-core") || error.stack?.includes("swiper_vue") || error.stack?.includes("swiper/modules"))
    );
}

nuxtApp.vueApp.config.errorHandler = (error, instance, info) => {
  
    if (testSwiperError(error, instance, info)) {
        console.warn("[Handled Swiper Error]:", error.message);
        return;
    }
    throw error;
}

nuxtApp.hook('vue:error', (error, instance, info) => {
    
    if (testSw…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nWacky
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants