[๐] SSG ignoring the index page when trailingSlash is false
franck-co opened this issue ยท 3 comments
franck-co commented
Which component is affected?
Qwik City (routing)
Describe the bug
Given the following routes directory
routes
โโ (group)
โโ index.tsx
โโ articles
โโ index.tsx
SSG is generating articles.html
successfully but the top level index.html
is missing when trailingSlash
option is set to false
.
I suspect the line below :
qwik/packages/qwik-city/static/main-thread.ts
Line 143 in 25c0c98
When trailingSlash
is enabled, pathname
is '/'
and it's working
When trailingSlash
is disabled pathname
is ''
and the condition evaluates to false
, thus never adding the page to SSG queue.
Reproduction
https://stackblitz.com/edit/qwik-starter-zmev6t
Steps to reproduce
- Run
npm install
thennpm run build
- Observe the
dist
folder not having index.html - Set
trailingSlash
totrue
invite.config.js
- Run
npm run build
again index.html
is now present in thedist
folder
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
CPU: (2) x64 Intel Core Processor (Haswell, no TSX)
Memory: 22.34 GB / 28.68 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
pnpm: 9.0.6 - ~/.local/share/pnpm/pnpm
Browsers:
Chromium: 124.0.6367.118
npmPackages:
@builder.io/qwik: 1.5.3 => 1.5.3
@builder.io/qwik-city: 1.5.3 => 1.5.3
@builder.io/qwik-labs: github:QwikDev/qwik-labs-build => 0.0.1
@builder.io/sdk-qwik: 0.14.21 => 0.14.21
typescript: 5.4.5 => 5.4.5
undici: ^6.15.0 => 6.15.0
vite: 5.2.11 => 5.2.11
Additional Information
No response
PatrickJS commented
@franck-co can you make a PR
JerryWu1234 commented
@franck-co can you make a PR
I will do