Repository: vikejs/vike

Issue #812: V1 Cannot Override Config via Convenience File
Created: 2023-04-23T22:59:56Z
Description
Possibly I am misunderstanding V1 design, but it appears impossible to override default configs. Eg. if I have pages/+onRenderHtml then any other file like pages/about/+onRenderHtml will throw an error.
Reproduction:
main...dajinchu:vite-plugin-ssr:v1-renderer-bug
Error Message + Error Stack
at resolveConfigElement (/workspaces/vite-plugin-ssr/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigData.js:215:32)
    at /workspaces/vite-plugin-ssr/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigData.js:135:35
    at Array.forEach (<anonymous>)
    at /workspaces/vite-plugin-ssr/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigData.js:134:63
    at Array.forEach (<anonymous>)
    at loadConfigData (/workspaces/vite-plugin-ssr/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigData.js:115:13)
    at async getVirtualFileImportPageConfigs (/workspaces/vite-plugin-ssr/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFileImportPageConfigs.js:11:51)
    at async generateGlobImports (/workspaces/vite-plugin-ssr/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js:149:3)
    at async getCode (/workspaces/vite-plugin-ssr/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js:32:20)
    at async getVirtualFileImportUserCode (/workspaces/vite-plugin-ssr/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js:19:18)
    at async Context.load (/workspaces/vite-plugin-ssr/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/index.js:46:30)
    at async Object.load (file:///workspaces/vite-plugin-ssr/node_modules/.pnpm/vite@4.0.3_@types+node@17.0.31/node_modules/vite/dist/node/chunks/dep-0bae2027.js:41453:32)
    at async loadAndTransform (file:///workspaces/vite-plugin-ssr/node_modules/.pnpm/vite@4.0.3_@types+node@17.0.31/node_modules/vite/dist/node/chunks/dep-0bae2027.js:39225:24)

Duplicate issue #816: +config.ts getConfigData.js
Created: 2023-04-24T21:03:30Z
Description
hello I'm trying the new version this message appears to me after configuring +config.ts
export default {
  prerender: false,
  clientRouting: true,
  hydrationCanBeAborted: true,
  passToClient: [
    'pageProps',
    'documentProps',
    'urqlState',
    'redirectTo',
    'routeParams',
    'token',
    'session',
    'settings'
  ],
  meta: {
    documentProps: {
      env: 'server-and-client'
    },
    title: {
      env: 'server-only'
    },
    description: {
      env: 'server-only'
    },
    Layout: {
      env: 'server-and-client'
    }
  }
} satisfies Config
thx
Error Message + Error Stack
/Users/enri/Code/urql/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigData.js:215
            (0, utils_1.assert)(configValueFiles.length === 1);
                               ^
Error: [vite-plugin-ssr@0.4.116][Bug] You stumbled upon a bug in vite-plugin-ssr's source code. Go to https://github.com/brillout/vite-plugin-ssr/issues/new and copy-paste this error. (The error's stack trace is usually enough to fix the problem). A maintainer will fix the bug (usually under 24 hours). Don't hesitate to reach out as it makes vite-plugin-ssr more robust.
    at resolveConfigElement (/Users/enri/Code/urql/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigData.js:215:32)
    at /Users/enri/Code/urql/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigData.js:135:35
    at Array.forEach (<anonymous>)
    at /Users/enri/Code/urql/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigData.js:134:63
    at Array.forEach (<anonymous>)
    at loadConfigData (/Users/enri/Code/urql/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigData.js:115:13)
    at async resolveConfig (/Users/enri/Code/urql/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/config/index.js:28:48)

Closing comment (2023-04-24T21:09:50Z): Seems to be a duplicate of #812.