Skip to main content
Filter by
Sorted by
Tagged with
62 votes
4 answers
146k views

I want to expose my svelte app on LAN using the npm run dev --host command but it shows: > [email protected] dev > svelte-kit dev SvelteKit v1.0.0-next.295 local: http://localhost:3000 ...
blest's user avatar
  • 849
46 votes
5 answers
59k views

I have been using Svelte for a little while and now I have switched to SvelteKit so I can add multiple pages. I want to add some images to my site but I don't know where to put them. In Svelte I would ...
Anders's user avatar
  • 1,117
40 votes
5 answers
59k views

I am a newbie on Svelte and in coding in general. I'd prefer to learn SvelteKit (Svelte@Next) rather than sapper since that seems to be where Svelte is heading. For my personal project, I need to ...
Johny Chen's user avatar
33 votes
3 answers
17k views

In layout.server.ts I try to import type { LayoutServerLoad } from './$types'; but the type can't be found: '"./$types"' has no exported member named 'LayoutServerLoad'. Did you mean '...
Nausika's user avatar
  • 795
31 votes
5 answers
17k views

I want to use environment variables in my Sveltekit app - it works fine on dev server, but I get this build error: Error: 'PUBLIC_KEY' is not exported by $env/static/public, imported by src/routes/+...
Stiegi's user avatar
  • 1,887
31 votes
4 answers
32k views

I am new to SvelteKit and have built an initial project from the SvelteKit docs. When the project opens I receive the following error when looking at index.svelte. Error in svelte.config.js Error [...
jonthornham's user avatar
  • 3,395
28 votes
3 answers
79k views

I have a page with content rendered from a SvelteKit store. If the store is invalid, a user needs do be redirected to the homepage. Unfortunately, I can't find a way to redirect a user even without ...
Theo's user avatar
  • 392
26 votes
2 answers
9k views

Is it possible to build a SvelteKit project to a single output HTML file which inlines all JS and CSS? Could SvelteKit be configured to support this output format or do I need to use an external build ...
Samuel Plumppu's user avatar
23 votes
1 answer
12k views

The Svelte documentation shows how to set an element on locals in hooks: https://kit.svelte.dev/docs/hooks#server-hooks event.locals.user = await getUserInformation(event.cookies.get('sessionid')); ...
CordlessWool's user avatar
  • 1,569
22 votes
1 answer
11k views

I'm trying to launch drizzle studio but I get the following error : Error: There is not enough information to infer relation "restaurantsTable.categories" What have I done wrong ? schema.ts ...
Sowdowdow's user avatar
  • 301
21 votes
2 answers
17k views

I'm trying to do API calls in a SvelteKit page from the load function, but I don't want to proxy these calls with local endpoints because I want to keep the web server as light as possible. What I ...
cambraca's user avatar
  • 28k
18 votes
5 answers
26k views

I normally use the following to redirect to any page without using window.location.href in Sveltekit import { goto } from '$app/navigation'; const goSomeWhere = () :void => { goto('/') } But ...
yongju lee's user avatar
18 votes
1 answer
18k views

I am deploying sveltekit to a dfinity container and I need to disable minification to debug. I have to build a static version to deploy it with npm run build -- is there a vite option to disable ...
chovy's user avatar
  • 76.2k
17 votes
3 answers
19k views

I want to use Svelte in my next project, due to its clean syntax and how nice is to work in it. Unfortunately, to deploy the app in my company I can't use node or anything like that on the server. I ...
Djent's user avatar
  • 3,509
16 votes
7 answers
31k views

I'm using the following combination of technologies: SvelteKit (1.5.0, using TypeScript), with Vite (4.0.0) as the build tool that comes with SvelteKit) Svelte's adapter-static (2.0.1) for publishing ...
Jeroen's user avatar
  • 64.4k
16 votes
1 answer
8k views

I just got started with SvelteKit and read the documentation. I would like to use SSG in my app and prerender every page. I configured my app as the documentation said but nothing seems to work as ...
Matyanson's user avatar
  • 321
15 votes
3 answers
15k views

I would like to import apexChart library which using "window" property, and i get error in console. [vite] Error when evaluating SSR module /src/routes/prehled.svelte: ReferenceError: window ...
LukasGur's user avatar
  • 361
14 votes
2 answers
18k views

I want to use a generic type in a Svelte(Kit) component's props, and I found out there is this type T = $$Generic thing: <script lang="ts"> import type { Writable } from "svelte/...
Kevin Renskers's user avatar
14 votes
1 answer
6k views

Svelte 5 Slots are Confusing Now, with Svelte 5 at pre-release, I feel I can express some confusion about slots in Svelte 5. In Svelte 4, slot and names slots where done in the following way: ...
Tithos's user avatar
  • 1,457
14 votes
1 answer
12k views

I have Cypress tests failing only on Github CI with this error: Your page did not fire its `load` event within `60000ms`. I assume this is because the Cypress browser is stuck loading something ...
Mikko Ohtamaa's user avatar
13 votes
3 answers
7k views

I'm trying to create a system in my SvelteKit app where it shows you info about the current app version (ideally a Git commit hash and description) on a certain page. I tried using Vite's define ...
heftymouse's user avatar
13 votes
2 answers
12k views

If the file test.svelte below is a Page in /routes, it successfully calls load() and populates the template with the JSON array it retrieves when I access it via http://localhost:3000/test. If I move ...
nstuyvesant's user avatar
  • 1,536
13 votes
1 answer
11k views

I'm trying to import the PageLoad function for the SvelteKit load function according to the docs. The import does not seem to exist. This is a brand new app with the latest version of SvelteKit. It ...
Jonathan's user avatar
  • 4,135
12 votes
6 answers
16k views

I'm working on a sveltekit app with a sidenav containing links. I can't get the active class styling on my links to work properly. The links are components in NavLink.svelte: <script> import { ...
fastasleep's user avatar
12 votes
2 answers
13k views

In Nuxt, I use the Style Resources package to make SCSS available globally and I can access variables and mixins in any component. How to do the same in SvelteKit?
system0102's user avatar

1
2 3 4 5
61