Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐞] SSG ignoring the index page when trailingSlash is false #6247

Closed
franck-co opened this issue May 6, 2024 · 3 comments
Closed

[🐞] SSG ignoring the index page when trailingSlash is false #6247

franck-co opened this issue May 6, 2024 · 3 comments
Assignees
Labels
COMMUNITY: good first issue Good for newcomers TYPE: bug Something isn't working

Comments

@franck-co
Copy link

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 franck-co added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels May 6, 2024
@PatrickJS
Copy link
Member

@franck-co can you make a PR

@PatrickJS PatrickJS added COMMUNITY: good first issue Good for newcomers and removed STATUS-1: needs triage New issue which needs to be triaged labels May 6, 2024
@JerryWu1234
Copy link
Contributor

@franck-co can you make a PR

I will do

@gioboa
Copy link
Member

gioboa commented May 13, 2024

Closed by #6304

@gioboa gioboa closed this as completed May 13, 2024
@JerryWu1234 JerryWu1234 mentioned this issue May 17, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMMUNITY: good first issue Good for newcomers TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants