I am using svelte 5 with typescript,this is my vite conf,
import { sveltekit } from '@sveltejs/kit/vite';import { defineConfig } from 'vitest/config';export default defineConfig({ plugins: [sveltekit()], test: { include: ['src/**/*.{test,spec}.{js,ts}'] }, worker: { format: "es" },});
this is my svelte conf,
import adapter from '@sveltejs/adapter-node';import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';/** @type {import('@sveltejs/kit').Config} */const config = { preprocess: vitePreprocess(), kit: { adapter: adapter(), files: { hooks: { client: 'src/lib/client/hooks.client', server: 'src/lib/server/hooks.server' }, appTemplate: 'src/lib/client/app.html', errorTemplate: 'src/lib/client/error.html', serviceWorker: 'src/lib/client/service-worker' }, }};export default config;
As you can see i did not block the ssr , or manualy on the pages with export const ssr = false,but on my network tab, i checked the inital get request and my body shows up like this which is blocking the seo tools to understand my page content,
<body data-sveltekit-preload-data="hover"><div style="display: contents"><!--[--><!--[--><!----><!--[!--><!--]--><!----><!--]--> <!--[!--><!--]--><!--]--><script> { __sveltekit_dev = { base: new URL(".", location).pathname.slice(0, -1), env: {"PUBLIC_APP_ID":"0e4800----6b739","PUBLIC_FIREBASE_ALIAS":"m---tchi","PUBLIC_FIREBASE_ROOT_FOLDER":"--e-i","PUBLIC_FIREBASE_STORAGE_BUCKET":"me000----spot.com","PUBLIC_TELEGRAM_BOT_TOKEN":"715749------K_c","PUBLIC_TELEGRAM_CHAT_ID":"-----"} }; const element = document.currentScript.parentElement; const data = [{"type":"data","data":{claims:void 0},"uses":{"dependencies":["app:user"]}},{"type":"data","data":null,"uses":{"dependencies":["app:room"]}}]; Promise.all([ import("/@fs/C:/AISocialMedia/aisocial/node_modules/@sveltejs/kit/src/runtime/client/entry.js"), import("/@fs/C:/AISocialMedia/aisocial/.svelte-kit/generated/client/app.js") ]).then(([kit, app]) => { kit.start(app, element, { node_ids: [0, 3], data, form: null, error: null }); }); }</script></div></body>
So server side rendering not working for me , all my pages like this, i was thinking maybe using a client side sdk on the front page makes it . But issue is on all the pages.