'Vue Component including Inertiajs-Link Not working in Project

I'm going to build small UI library package with Vue components and use it in my Inertia-Laravel Project.

//Logo.vue

<template>
    <Link href="/" class="text-xl font-bold flex items-center lg:ml-2.5">
        My Logo
    </Link>
</template>
<script>
import { Link } from '@inertiajs/inertia-vue3'
export default {
    name: "Logo", 
    components: {
        Link,
    },
}
</script>

I was able to build this as package Vite or Vue-SFC-RollUp and publish it on npm.

But when I was going to install it on my inertia/laravel projects and use it, I got some warning and error.

MyProjectComponent.vue

<template>
...
<Logo />
...
</template>
<script>
import {Logo} from 'mypackage-ui'

export default {
components: {Logo}
}
</script>

Error message:

export 'default' (imported as  'require$$1') was not found in 'vue' 
(possible exports: BaseTransition, Comment, EffectScope, ... , withScopeId)

If I remove <Link> in Logo.vue and use <a> tag and update package, then it's working well.

Any suggestion would be highly appreciated. I'm using Vue 3.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source