bridge icon indicating copy to clipboard operation
bridge copied to clipboard

config.srcDir invalidate

Open poyoho opened this issue 3 years ago • 2 comments

Environment


  • Operating System: Darwin
  • Node Version: v16.13.1
  • Nuxt Version: 2.15.8
  • Package Manager: [email protected]
  • Builder: webpack
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

export default defineNuxtConfig({
  srcDir: 'src/',
  buildModules: ['@unocss/nuxt', '@nuxt/bridge-edge'],
  components: true,
  bridge: {
    vite: true,
    icons: true
  },
  css: ['@unocss/reset/tailwind.css'],
  vite: {
  },
  unocss: {
    uno: true,
    attributify: true,
    icons: {
      scale: 1.2
    }
  },
  icons: {}
})

Describe the bug

when setting srcDir nuxt will throw an error.

[unocss] entry module not found, have you add `import 'uno.css'` in your main entry?
[nuxt] [request error] _createApp is not a function
  at Object.renderToString (./node_modules/vue-bundle-renderer/dist/index.mjs:264:25)  
  at async ./.nuxt/dev/index.mjs:496:20  
  at async /node_modules/.pnpm/[email protected]/node_modules/h3/dist/index.mjs:420:19  
  at async Server.nodeHandler (/node_modules/.pnpm/[email protected]/node_modules/h3/dist/index.mjs:370:7)

Additional context

but setting config.buildDir inside of the srcDir nuxt will run well.

for example:

export default defineNuxtConfig({
  srcDir: 'src/',
  buildDir: 'src/.nuxt/',
  buildModules: ['@unocss/nuxt', '@nuxt/bridge-edge'],
  components: true,
  bridge: {
    vite: true,
    icons: true
  },
  css: ['@unocss/reset/tailwind.css'],
  vite: {
  },
  unocss: {
    uno: true,
    attributify: true,
    icons: {
      scale: 1.2
    }
  },
  icons: {}
})

No response

Logs

No response

poyoho avatar Jul 19 '22 06:07 poyoho

same problem

Ttou avatar Jul 24 '22 10:07 Ttou

Same issue here. Not working with this setting:

srcDir: 'src',

bridge: {
  vite: true,
  nitro: true,
},

But it works correctly when disabled Vite.

emretepedev avatar Dec 30 '22 22:12 emretepedev