Describe the bug
Consider a custom path returned via the includedRoutes hook:
includedRoutes(_paths:any[], routes:any[]) {
// use original route records
return routes.flatMap((route:any) => route.path + (route.path.endsWith('/') ? 'index' : '/index'));
},
If such paths are returned via the includedRoutes hook, the pages content is not prerendered but looks like this:
<body>
<div id="app" data-server-rendered="true"><!----></div>
</body>
Have a look at the provided reproduction repo and run the npm run build command. The expected output of the pages content is:
<body>
<div id="app" data-server-rendered="true"> TestContent </div>
<body>
This expected output can be achieved if the includedRoutes hook is removed from the vite config, but should also be present if includedRoutes are specified.
Reproduction
https://github.com/derMart/vite-ssg-includedroutes-bug
System Info
System:
OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
Binaries:
Node: 20.15.1 - ~/.nvm/versions/node/v20.15.1/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v20.15.1/bin/npm
Used Package Manager
npm
Validations
Contributions
Describe the bug
Consider a custom path returned via the includedRoutes hook:
If such paths are returned via the includedRoutes hook, the pages content is not prerendered but looks like this:
Have a look at the provided reproduction repo and run the
npm run buildcommand. The expected output of the pages content is:This expected output can be achieved if the
includedRouteshook is removed from the vite config, but should also be present if includedRoutes are specified.Reproduction
https://github.com/derMart/vite-ssg-includedroutes-bug
System Info
Used Package Manager
npm
Validations
Contributions