vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.8k stars 392 forks source link

[Nuxt 3 Preview App Error] Outside of Vite serving allow list #2287

Closed mwohlan closed 1 year ago

mwohlan commented 1 year ago

When trying to use the Preview Nuxt App feature, I get this error:

The request url "/home/mwohlan/.vscode/extensions/vue.volar-1.0.22-linux-x64/dist/preview-bin/nuxi/plugin.ts" is outside of Vite serving allow list.

Nuxt project info:


  • Operating System: Linux
  • Node Version: v18.12.1
  • Nuxt Version: 3.0.1-rc.0-27880943.da38c62
  • Nitro Version: 2.0.0-27860563.409fe2b
  • Package Manager: pnpm@7.17.0
  • Builder: vite
  • User Config: modules, imports, fontMetrics, ssr, experimental, routeRules, unocss, typescript, headlessui, css, runtimeConfig, supabase, app, vite
  • Runtime Modules: @vueuse/nuxt@9.10.0, @unocss/nuxt@0.48.0, @pinia/nuxt@0.4.6, @nuxtjs/supabase@0.3.0, nuxt-headlessui@1.0.4, @vueuse/motion/nuxt@2.0.0-beta.26, @nuxtjs/fontaine@0.2.4
  • Build Modules: -

Adding

vite: {
server: {
      fs: {
        allow: ['/home/mwohlan/.vscode/extensions/vue.volar-1.0.22-linux-x64/dist/preview-bin/nuxi'],
      },
    },
  },

to the nuxt config fixes the issue, but maybe this can be fixed differently, without changing the vite config in nuxt.

RomanKollerSnoop commented 3 months ago

Having the same issue. I can not add fs allow my local path into a large project, where other people work on. Is there a way to stop vite from using node modules from another project? The annoyance is big.