Routing in app built by adapter-static is broken in next.266
See original GitHub issueDescribe the bug
Since upgrading to the latest version of SvelteKit a site which is compiled with the static adapter no longer works when served via Nginx.
For example routing to https://mywebsite.com works but routing to https://mywebsite.com/hello results in 404. If I were to navigate to the second link internally via an <a>
the 404 would not appear. I can resolve the issue by pinning the SvelteKit version to something like 250 but being on the HEAD manifests the error.
Reproduction
- Build any site with static adapter and SvelteKit version 266
- Host output with a web server such as nginx
- Route to anything except index.html directly or navigate there and refresh. For example https//mysite.com/anotherpage
Logs
No response
System Info
System:
OS: macOS 12.2
CPU: (8) arm64 Apple M1
Memory: 553.13 MB / 16.00 GB
Shell: 3.3.1 - /opt/homebrew/bin/fish
Binaries:
Node: 17.4.0 - /opt/homebrew/bin/node
Yarn: 1.22.10 - /opt/homebrew/bin/yarn
npm: 8.3.1 - /opt/homebrew/bin/npm
Browsers:
Brave Browser: 96.1.32.115
Chrome: 98.0.4758.80
Firefox: 97.0
Safari: 15.3
npmPackages:
@sveltejs/adapter-static: next => 1.0.0-next.28
@sveltejs/kit: next => 1.0.0-next.266
svelte: ^3.46.4 => 3.46.4
Severity
serious, but I can work around it
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:11 (6 by maintainers)
Top Results From Across the Web
266 bus Route Map - Bot Boyer Markt - Moovit
The 266 bus (Bot Boyer Markt) has 16 stops departing from Bot Zob Berliner Platz and ending in Bot Boyer Markt. 266 bus...
Read more >Windows 10 hyper-v default switch problems when VPN ...
The problem seems like there is no routing from default switch to VPN. ... Sure you can set up vms with an external...
Read more >ata-dallas-737-800 & -300 tools - Starman Auctions
266, HOIST,BOOM THRUST W/FORCE GAUGE, AIR SPARES, I C78026-156. 267, HOIST,FISHPOLE, MORGAN AERO, AP6108. 268, HOIST, FISHPOLE 737, MORGAN AERO, AP6108.
Read more >Los Angeles - 266 Metro Local Line • Bus route • Transitland
Metro - Los Angeles - 266 Metro Local Line is a Bus route available for browsing and analyzing on the Transitland platform.
Read more >266 bus route - Transport for London
266. Towards Brent Cross. From: Acton Old Town Hall To: Brent Cross Shopping Centre.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please take a look at
trailingSlash: 'always'
: https://kit.svelte.dev/docs/configuration#trailingslashIf you set that option it will generate
index.html
files for you and I think it should address this issueI’m on
"@sveltejs/kit": "1.0.0-next.278"
with"@sveltejs/adapter-static": "1.0.0-next.28"
and with defaulttrailingSlash
(never
).I have this in (the default for new demo init project)
app.html
:The issues in my case are:
favicon
http://localhost:3000/images/icons/favicon.png
) now instead the path is wrong based on which route I’m in, example:http://localhost:3000/users/images/icons/favicon.png
orhttp://localhost:3000/players/images/icons/favicon.png
.If I use
trailingSlash: "always"
the generated .html is empty! 0 KB!