docus
docus copied to clipboard
Error on search on new project
After creating a new project and starting the dev server, the following error appears in console:
Uncaught SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@vueuse/integrations/useFuse.mjs?v=d41e5a87' does not provide an export named 'UseFuseOptions'
Also, the search functionality does not work because of this.
The error comes from the component components/app/AppSearch.vue in the following import:
import { useFuse, UseFuseOptions } from '@vueuse/integrations/useFuse'
I have the same ussue
This is due to a new compilerOptions that the nuxt team decided to set to true by default which require all type imports to be explicitly imported like import type {useFuseOptions} from ...
The fix was already made in the repo but in the meantime, you can just disable verbatimModuleSyntax by adding this in your nuxt.config
export default defineNuxtConfig({
typescript: {
tsConfig: {
compilerOptions: {
verbatimModuleSyntax: false
}
}
}
})
This MR fixes it and is already merged so the fix would be in the next release: https://github.com/nuxt-themes/docus/pull/997
@trc-mathieu I've been looking all night for this. Thank you so much!