bridge
bridge copied to clipboard
config.srcDir invalidate
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
same problem
Same issue here. Not working with this setting:
srcDir: 'src',
bridge: {
vite: true,
nitro: true,
},
But it works correctly when disabled Vite.