[๐Ÿž] vite config trailingSlash: false breaks home route

See original GitHub issue

Which component is affected?

Qwik City (routing)

Describe the bug

Disabling trailing slashes on the vite config breaks the rendering of the home route. As mentioned here https://github.com/BuilderIO/qwik/issues/2262.

Reproduction

https://stackblitz.com/edit/qwik-starter-rcw5u8?file=vite.config.ts

Steps to reproduce

  • Open the repro from above
  • Wait till the preview is loaded
  • Check server terminal output and youโ€™ll see a blank screen

System Info

System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Max
    Memory: 12.70 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.0 - /var/folders/34/mgxs4kqs24s8kl0jfxg9jng00000gn/T/fnm_multishells/76891_1669932626637/bin/node
    Yarn: 1.22.18 - /var/folders/34/mgxs4kqs24s8kl0jfxg9jng00000gn/T/fnm_multishells/76891_1669932626637/bin/yarn
    npm: 8.1.0 - /var/folders/34/mgxs4kqs24s8kl0jfxg9jng00000gn/T/fnm_multishells/76891_1669932626637/bin/npm
  Browsers:
    Brave Browser: 104.1.42.88
    Chrome: 107.0.5304.121
    Chrome Canary: 110.0.5451.0
    Firefox: 107.0.1
    Safari: 16.0
    Safari Technology Preview: 16.4
  npmPackages:
    @builder.io/qwik: 0.15.0 => 0.15.0 
    @builder.io/qwik-city: 0.0.128 => 0.0.128 
    vite: 3.2.4 => 3.2.4

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
hyunjuniancommented, Dec 23, 2022

@zanettin Thank you for the answer. I checked this issue for v0.1.0 and the issue is solved. I will use the 0.1.0-beta5 instead of 0.0.128. Thank you for your great works on qwik!

1reaction
hyunjuniancommented, Dec 22, 2022

@adamdbradley Thank you for your work! However, there is another problem.

When I added {trailingSlash: false}, the root page(/) is not shown.

Please check this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inconsistent URL trailing slash behavior between dev ... - GitHub
Describe the bug Multi-page apps created with Vite do not behave consistently between dev and build preview when visiting nested URLs thatย ...
Read more >
Configuring Vite
Configuring Vite #. When running vite from the command line, Vite will automatically try to resolve a config file named vite.config.js inside project...
Read more >
Trailing Slash - next.config.js
You can configure this behavior to act the opposite way, where urls without trailing slashes are redirected to their counterparts with trailing slashes....
Read more >
How do I remove a trailing slash from routes in Nuxt v2.15 ...
I am currently using the router config trailingSlash: false as well as middleware that redirects to the route without a slash.
Read more >
Should You Have a Trailing Slash at the End of URLs? - Ahrefs
A trailing slash is a forward slash (โ€œ/โ€) placed at the end of a URL such ... nothing after this path, usually a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found