You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have django for backend and (trying to have) svelte on the frontend.
I'm serving the static output of sveltekit via django & whitenoise (but I can also reproduce it with a simple python server, so it's not about django).
in django, I'm returning index.html for any path that doesn't exist: urls.py
this works fine with an angular-based front-end (using ng build --base-href=/static/spa/) , but svelte is just stuck in a redirect loop no matter what I try.
I'm doing everything I've found in docs. the initial load correctly finds all the js files and the index.html, but it just shows a white page and it infinitely redirects to something -- I can't quite debug it as it's happening really fast.
svelte.config.js
// import adapterAuto from '@sveltejs/adapter-auto';
import adapterStatic from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
adapter: adapterStatic({
fallback: 'index.html', // SPA mode // may differ from host to host
pages: "../.frontend-dist",
}),
prerender: {
entries: []
},
paths: {
base: "/static/spa",
}
},
};
export default config;
any help is appreciated
Reproduction
I'm sure this is immediately obvious to maintainers. please just go over my message and I'm sure you'll know why it happens, it's probably a hidden config I'm missing that I'm not aware of
Describe the bug
I have django for backend and (trying to have) svelte on the frontend.
I'm serving the static output of sveltekit via django & whitenoise (but I can also reproduce it with a simple python server, so it's not about django).
in django, I'm returning index.html for any path that doesn't exist:
urls.py
this works fine with an angular-based front-end (using
ng build --base-href=/static/spa/
) , but svelte is just stuck in a redirect loop no matter what I try.I'm doing everything I've found in docs. the initial load correctly finds all the js files and the index.html, but it just shows a white page and it infinitely redirects to something -- I can't quite debug it as it's happening really fast.
svelte.config.js
any help is appreciated
Reproduction
I'm sure this is immediately obvious to maintainers. please just go over my message and I'm sure you'll know why it happens, it's probably a hidden config I'm missing that I'm not aware of
Logs
No response
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: