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

Integration Nuxt + Typescript #16

Open
LuizPelegrini opened this issue Aug 17, 2021 · 1 comment
Open

Integration Nuxt + Typescript #16

LuizPelegrini opened this issue Aug 17, 2021 · 1 comment

Comments

@LuizPelegrini
Copy link

Hi there, I am trying to use the package in a Nuxt project with typescript and I am getting this error when I try to use it

Type 'typeof import("~/node_modules/oh-vue-icons/types/index")' is not assignable to type 'Component<any, any, any, any> | AsyncComponent<any, any, any, any>'.
Type 'typeof import("~/node_modules/oh-vue-icons/types/index")' is not assignable to type 'AsyncComponentFactory<any, any, any, any>'.
Type 'typeof import("~/node_modules/oh-vue-icons/types/index")' provides no match for the signature '(): { component: Promise<ImportedComponent<any, any, any, any>>; loading?: ImportedComponent<DefaultData<never>, DefaultMethods<never>, DefaultComputed, DefaultProps> | undefined; error?: ImportedComponent<...> | undefined; delay?: number | undefined; timeout?: number | undefined; }'.

Usage:

<script lang="ts">
import Vue from 'vue';
import OhVueIcon from 'oh-vue-icons';

export default Vue.extend({
  components: {
    'v-icon': OhVueIcon, // <<< error is thrown here
  },
});
</script>

I've already added the transpilation step in nuxt.config.js

build: {
    transpile: ['oh-vue-icons']
}

Is there anything I'm missing here?

@Renovamen
Copy link
Owner

Hi, have you tried importing the package following this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants