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
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
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
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
5 votes
2 answers
3k views

How to pass in parameters from client side to server side code in Sveltekit?

I've been trying to run a query to a Supabase database that needs a dog breed passed through and will return metrics about it, the breed is defined on the client side. I was able to get the server ...
BeratK2's user avatar
  • 63
4 votes
1 answer
3k views

SvelteKit stores don't match client-side and server-side

In SvelteKit, it seems that stores do not sync between the client-side and server-side. In other words, if one modifies a store on the client-side, when it is retrieved on the server-side, it will not ...
Basil's user avatar
  • 598
0 votes
1 answer
2k views

Build generated from adapter-node is not working for official SvelteKit example

I am trying offical SvelteKit example https://realworld.svelte.dev/. Its code is hosted at https://github.com/sveltejs/realworld I tried to generate SSR build out of this project using adapter-node My ...
Alok's user avatar
  • 10.8k
1 vote
1 answer
411 views

How can I stop sveltekit serving a 7MB bundled lang file in favour of just the correct one?

I have a static class for localising the data on my site, and I want to be able to load the required files, rather than all of them. It was fine for testing, but in production, each page that requires ...
xKeeg's user avatar
  • 43
3 votes
1 answer
2k views

How does server side rendering work with client side routing in SvelteKit?

I have just read on the SvelteKit docs that SSR is enabled by default and you need to manually disabled it if you don't want it present. This is great for SEO so I'm happy that SvelteKit enforces this ...
Matthew Honour's user avatar
1 vote
1 answer
2k views

SvelteKit Hook Prevents Endpoint Request

Trying out SvelteKit and I'm having a hard time with hooks. The docs don't really seem to explain it all too well. My current understanding of hooks is that they basically allow you to interact with ...
prismo's user avatar
  • 1,909
7 votes
3 answers
2k views

SvelteKit Rendering a Random Prop is different between server and client

I would like to make a component in SvelteKit which has a randomized parameter. The problem is that the value this parameter takes is different for when the page is rendered server-side versus when ...
Auroratide's user avatar
  • 2,632
8 votes
2 answers
25k views

Error when evaluating SSR module even when SSR is disabled - svelte-kit

I wanted one of my route in my app not to be server side rendered. The way to do this will be doing export const ssr = false in module script or setting ssr: false in svelte.config.js as mention in ...
GAGANDEEP SINGH's user avatar
3 votes
1 answer
5k views

Sveltekit fetch file from static folder

In sveltekit i have a static folder, in which i have .zip file, to get it locally i do something like: const res = await fetch("/static/makeup.zip") It works fine, but when i deployed my app ...
Alexander's user avatar
  • 115
0 votes
1 answer
436 views

Initialize writable svelte store from sapper preload

I want to do something like this: <script context="module"> export async function preload() { const topicRes = await this.fetch(`topics/all.json`).catch((error) => { ...
mtyson's user avatar
  • 8,590
2 votes
1 answer
879 views

Authentication in Sapper/Svelte in GraphQL API

I'm trying to make a SSR-app using Sapper+Svelte which utilizes GraphQL API. I've checked the project https://github.com/antony/sapper-authentication-demo and read official docs, but I can't make it ...
djangomaster's user avatar

15 30 50 per page