QwikDev/qwik

[๐Ÿž] SSG ignoring the index page when trailingSlash is false

franck-co opened this issue ยท 3 comments

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 :

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

  1. Run npm install then npm run build
  2. Observe the dist folder not having index.html
  3. Set trailingSlash to true in vite.config.js
  4. Run npm run build again
  5. index.html is now present in the dist 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

@franck-co can you make a PR

@franck-co can you make a PR

I will do

Closed by #6304