vikejs / vike

🔨 Flexible, lean, community-driven, dependable, fast Vite-based frontend framework.
https://vike.dev
MIT License
4.21k stars 348 forks source link

vike-react/config sets an unknown config Loading when use both `vike-react` and `vike-vue` #1812

Closed vitalybaev closed 1 month ago

vitalybaev commented 1 month ago

Description

I'm not sure, that it's a bug, but looks strange to me.

I want to try both frameworks (React and Vue) in the single project, but on the different pages. From the documentation it seems that it should work.

But when I made minimal setup with both framework, running pnpm dev I get:

> test-vike-vue-with-react@0.0.1 dev /home/vitalybaev/test-vike-vue-with-react
> vite

Error: [vike][Wrong Usage] vike-react/config sets an unknown config Loading
    at handleUnknownConfig (file:///home/vitalybaev/test-vike-vue-with-react/node_modules/.pnpm/vike@0.4.184_vite@5.4.1/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:893:15)
    at assertConfigExists (file:///home/vitalybaev/test-vike-vue-with-react/node_modules/.pnpm/vike@0.4.184_vite@5.4.1/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:1003:5)
    at getConfigDefinition (file:///home/vitalybaev/test-vike-vue-with-react/node_modules/.pnpm/vike@0.4.184_vite@5.4.1/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:980:5)
    at eval (file:///home/vitalybaev/test-vike-vue-with-react/node_modules/.pnpm/vike@0.4.184_vite@5.4.1/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:326:31)
    at Array.forEach (<anonymous>)
    at eval (file:///home/vitalybaev/test-vike-vue-with-react/node_modules/.pnpm/vike@0.4.184_vite@5.4.1/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:323:21)
    at Array.forEach (<anonymous>)
    at assertUsageGlobalConfigs (file:///home/vitalybaev/test-vike-vue-with-react/node_modules/.pnpm/vike@0.4.184_vite@5.4.1/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:315:32)
 ELIFECYCLE  Command failed with exit code 1.

Source Code

Additional information

I scaffolded both projects with Bati:

pnpm create bati --react --tailwindcss --biome
pnpm create bati --vue --tailwindcss --biome

then I removed all unnecessary parts, like data fetching or todo page, created two route groups (react) and (vue) where placed respecting configuration.

brillout commented 1 month ago

Closing in favor of https://github.com/vikejs/vike/issues/1813.