Skip to main content

All Questions

1 vote
2 answers
82 views

How to check when window becomes available?

I am new to SvelteKit and I am not familiar with SSR. I have recently learned that window is only defined after the client-side has been loaded, which can be determined with the onMount hook. But here'...
Donald Zhu's user avatar
0 votes
1 answer
50 views

Svelte SSR: Why is writable store data being retained across multiple requests?

I am developing an application using Laravel, Inertia and Svelte. It's currently running SSR. Here's a simple code snippet that I use to set up the <title> tag in the <head> section, using ...
coderboy's user avatar
  • 1,857
0 votes
1 answer
44 views

With SvelteKit, in which file should I put the page options in?

According to the docs of page options here, it seems that prerender option could be put in either client files (namely +page.js and +layout.js) or server files (namely +page.server.js and +layout....
Yan's user avatar
  • 480
0 votes
1 answer
110 views

Sveltekit SSR not working even i didn't block it

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: [...
demonjoseph's user avatar
0 votes
1 answer
195 views

What is the purpose of data-svelte-h in Svelte SSR?

I am new to Svelte and have noticed that some elements in the SSR code generated by Svelte include a special data-svelte-h attribute on them, mostly static elements but I can't seem to find a pattern. ...
coderboy's user avatar
  • 1,857
0 votes
1 answer
66 views

how to fetch localStorage data on +page.ts with param.slug value in sveltekit project?

I'm new to svelte and was trying to fetch localStorage data on +page.ts with params.slug value but when manually from address bar visited, the page doesn't fetch those data and results in 404. My data ...
boredcodebyk's user avatar
1 vote
0 answers
185 views

SvelteKit Redirect 308 when trying to access internal API from +page.server.ts

I am trying to retrieve data from a local API endpoint route within my SvelteKit application. I can confirm the endpoint works by navigating directly to it at http://localhost:5173/api/getSummary?...
Rawrcasm's user avatar
0 votes
1 answer
413 views

Redirecting in AstroJS+Svelte SSR applicaton is not working

I have an AstroJS SSR app with a Svelte integration. I'm creating a user signup form in Svelte which I submit to an Astro API endpoint to sign up a user. Since the form is POSTed, I want to redirect ...
code-tinkerer's user avatar
1 vote
1 answer
115 views

running js on .NET backend

OK, I fully understand that this isn't how you are supposed to do things, but I want to experiment with it anyways. I have a somewhat large site with .cshtml files. So this is executed on the server ...
munHunger's user avatar
  • 3,061
1 vote
1 answer
747 views

+layout.svelte.ts and +page.server.ts are executed twice after a FETCH is done. No cookies are avalilable in those instances. With sveltekit why?

Using the default Sveltekit ("version": "2.5.4") demo application I have the following on the +page.server.ts: import type { PageServerLoad } from './$types'; export const ...
Mat70x7's user avatar
  • 132
0 votes
1 answer
1k views

How to pass data between +page.svelte and the respective +page.server in Sveltekit

Here is the scenario: I have a +page.svelte file which is render the data for me. I have a +page.server file for that. In the +page.server I'm fetching some data from an endpoint. The fetch request in ...
Asker's user avatar
  • 45
0 votes
1 answer
212 views

Cannot access locals from +page.server.js

I'm following this tutorial https://www.youtube.com/watch?v=doDKaKDvB30 on how to make a login/registration feature with sveltekit and pocketbase. Here's what the hooks.server.js looks like: import ...
Théo Neubeck's user avatar
0 votes
0 answers
334 views

structure of output __data.json sveltekit

load in +layout.server.js generates */endpoint/__data.json. the structure looks like { "type":"data", "nodes":[ { "type":"data", ...
dinocode's user avatar
1 vote
1 answer
374 views

Adding vercel.json breaks Vercel deployments

Adding a vercel.json file with the following cron job breaks Vercel deployments on master in my SvelteKit project. { "crons": [ { "path": "/api/cron", &...
Gabriel Ratener's user avatar
0 votes
0 answers
390 views

How to dynamically load a static page on a specific SvelteKit route?

I have a SvelteKit application running on a SSR-enabled adapter (adapter-node specifically), with most routes being standard Svelte components. However, on one of the website routes, I want to serve ...
goose_lake's user avatar
  • 1,532

15 30 50 per page
1
2 3 4 5 6