Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
2 answers
84 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
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
115 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
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
187 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
1 vote
1 answer
749 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
214 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
379 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
0 votes
0 answers
118 views

Dynamic serverside-rendered navbar, how to run script with CSR disabled?

Situation I currently have a system set up with my SvelteKit site where during pre-rendering, a server-side library collects a directory listing of my site by using the node's fs library.  I then use ...
Fasteroid's user avatar
  • 155
1 vote
2 answers
666 views

The requested module '@glidejs/glide' does not provide an export named 'default'

I have a svelte website & I'm using glidejs. Everything is working fine on my localhost, but once I deployed, I'm getting this error. I'm using node server adapter SyntaxError: The requested ...
Ahmed's user avatar
  • 525
1 vote
1 answer
496 views

How does the universal load function load non-serializable data on server-side

In the svelte-kit tutorial for universal load functions, the following example +page.server.js file is given, which causes an internal server error, because server-side loading only works with ...
kooru_hi's user avatar
0 votes
0 answers
234 views

What is best naming convention to distinguish between store and normal variable in svelte?

I am currently struggling with naming store(writable, readable etc) in svelte. store.ts export type CanvasContext = ReturnType<typeof createCanvasStore> export const createCanvasStore = () =>...
Eddie Jeong's user avatar

15 30 50 per page
1
2 3 4 5