docus icon indicating copy to clipboard operation
docus copied to clipboard

Error on search on new project

Open kmilogp8496 opened this issue 2 years ago • 3 comments

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'

kmilogp8496 avatar Nov 17 '23 13:11 kmilogp8496

I have the same ussue

shershen08 avatar Nov 18 '23 07:11 shershen08

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 avatar Nov 25 '23 15:11 trc-mathieu

@trc-mathieu I've been looking all night for this. Thank you so much!

LlamaTheHutt avatar Nov 28 '23 00:11 LlamaTheHutt