Closed
Description
Describe the bug
Few web servers (like SharePoint) serve few pages with urls that incude the default filename in them, i.e., www.domain.com/index.html
instead of www.domain.com
.
When hosting index.html
file built with adapter-static in such web servers, and opened as www.domain.com/index.html
, the page goes into infinite reloads finally throwing the following errors:
- Too many calls to Location or History APIs within a short timeframe.
- Uncaught (in promise) DOMException: The operation is insecure.
Reproduction
- Create a new Sveltekit project
- Set adapter to
adapter-static
insvelte.config.js
- Build and preview the page
- Add
/index.html
to the url (e.g., http://localhost:4173/index.html)
Logs
Too many calls to Location or History APIs within a short timeframe. index.html:19:45550
Uncaught (in promise) DOMException: The operation is insecure.
Ts http://localhost:4173/index.html:19
ws http://localhost:4173/index.html:19
Ms http://localhost:4173/index.html:21
<anonymous> http://localhost:4173/index.html:24
index.html:19
Too many calls to Location or History APIs within a short timeframe. index.html:19:34175
Uncaught (in promise) DOMException: The operation is insecure.
ws http://localhost:4173/index.html:19
Ms http://localhost:4173/index.html:21
<anonymous> http://localhost:4173/index.html:24
System Info
System:
OS: macOS 15.2
CPU: (12) arm64 Apple M2 Max
Memory: 86.55 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.12.2 - /usr/local/bin/node
npm: 10.5.2 - /usr/local/bin/npm
pnpm: 9.0.5 - /usr/local/bin/pnpm
Browsers:
Chrome: 131.0.6778.205
Edge: 131.0.2903.112
Safari: 18.2
npmPackages:
@sveltejs/adapter-auto: ^3.0.0 => 3.3.1
@sveltejs/adapter-static: ^3.0.8 => 3.0.8
@sveltejs/kit: ^2.0.0 => 2.15.1
@sveltejs/vite-plugin-svelte: ^4.0.0 => 4.0.4
svelte: ^5.0.0 => 5.16.5
vite: ^5.4.11 => 5.4.11
Severity
blocking all usage of SvelteKit
Additional Information
Unable to use SvelteKit for internal apps because of this issue.