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

Could not find a declaration file for module 'vue-instantsearch/vue3/es' #17

Closed
buluw opened this issue Dec 22, 2022 · 4 comments
Closed

Comments

@buluw
Copy link

buluw commented Dec 22, 2022

Hi there, thanks for your module!

How to solve this error message:
Could not find a declaration file for module 'vue-instantsearch/vue3/es'.
'D:/code/nuxt/test/testb/node_modules/.pnpm/vue-instantsearch@4.6.0/node_modules/vue-instantsearch/vue3/es/index.js'
implicitly has an 'any' type.ts(7016)

meilisearch in demo could run, but has this error message

vue-instantsearch

nuxt3 : 3.0.0
nuxt-meilisearch : 0.1.7
meilisearch : 0.30.2

@xlanex6
Copy link
Owner

xlanex6 commented Dec 24, 2022

Hi @buluw

your request is like to Vue-Instantsearch itself
But

I find this gist , could be helpful
maybe nor fully updated

https://gist.github.com/Tocas97/6b058a60108b67cc0109abbf3cef0fb3

Let me knows if it helps

@buluw
Copy link
Author

buluw commented Jan 9, 2023

thanks for reply
where should I place it?

@buluw
Copy link
Author

buluw commented Jan 11, 2023

I place the file [vue-instantsearch.d.ts](https://gist.github.com/Tocas97/6b058a60108b67cc0109abbf3cef0fb3#file-vue-instantsearch-d-ts) to ./types
and change declare module "vue-instantsearch" {...} to declare module "vue-instantsearch/vue3/es" {...}
it's no more error message, everything works fine for now

@buluw
Copy link
Author

buluw commented Jan 16, 2023

I found an easier way to use vue instanse components:

create vue-instantsearch.js into ./plugins

import InstantSearch from 'vue-instantsearch/vue3/es';
import { defineNuxtPlugin } from '#app'

export default defineNuxtPlugin(nuxtApp => {
    nuxtApp.vueApp.use(InstantSearch)
})

no more need use import in components

@buluw buluw closed this as completed Jan 30, 2023
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