mercs600 / vue3-perfect-scrollbar

Vue.js wrapper for perfect scrollbar for version 3
140 stars 20 forks source link

[Vue warn]: A plugin must either be a function or an object with an "install" function. with ssr #15

Open samehdoush opened 2 years ago

samehdoush commented 2 years ago

vite 3 + vue 3

ssr.js

import { createSSRApp, h } from 'vue';
import { renderToString } from '@vue/server-renderer';
import { createInertiaApp , Link} from '@inertiajs/inertia-vue3';
import createServer from '@inertiajs/server';
import PerfectScrollbar from 'vue3-perfect-scrollbar'
createServer((page) =>
    createInertiaApp({
   .............
        setup({ app, props, plugin }) {
            return createSSRApp({ render: () => h(app, props) })
                .use(plugin)
                .component('Link', Link)
                .use(PerfectScrollbar)
                .use(ZiggyVue, {
                    ...page.props.ziggy,
                    location: new URL(page.props.ziggy.location),
                });
        },
    })
);

alert console : [Vue warn]: A plugin must either be a function or an object with an "install" function. [Vue warn]: Failed to resolve component: perfect-scrollbar If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. TypeError: Invalid value used as weak map key