How to properly address Images and assets in sveltekit
i am totaly newbi in sveltekit,my main question is : Where to put images with SvelteKit? and how use it.in static folder, right?But this causes a problem:when in this route : "@domain/dashboard" ,I use...
View ArticleHow does Svelte Kit benefit from specifying unique IDs for looped items, and...
UserThe problem at hand revolves around understanding the necessity of specifying unique IDs for looped items in Svelte Kit. Specifically, the inquiry delves into the reasons behind this requirement,...
View ArticleWhy does Svelte update the middle component after the parent and child?
See https://svelte.dev/repl/89b164da451a45a48ad12ca8f113b13a?version=4.2.15. This a condensed example of what's going on in my application.There are 3 components: App, which renders Layout, which...
View ArticleStacked barplot in Sveltekit
I have the following data in a .js file:I now want to create a stacked barplot in the +page.svelte with PlantKey on the x-axis and the Quantity per MaterialKey on the y-axis. How do I do this?
View ArticleHow to skip initial reactivity for a variable within svelte components?
I have a simple custom component in Svelte, where I use reactivity to execute some code.<script lang="ts"> export let liked: boolean $: { //..code that should be executed when liked is toggled...
View ArticleHow to display the fetched data from the api on svelte?
first time i'm trying to write an app on svelte, i wrote the function to get the data from api and destructured the data to get only what i need. But i don't get how to render it?the function looks...
View ArticleHow to increase body size in requests Svelte
I am making some request that exceeds the limit of svelte of 512kb, I have checked this page on svelte docshttps://kit.svelte.dev/docs/adapter-node#environment-variables-body-size-limit, it says that i...
View ArticleUnable to get state of Svelte Checkbox component using Svelte 4, Svelte...
I've created a simple component in Svelte 4, to display a standard checkbox and label. This I've hooked into an instance of Storybook 8 with a decorator - this is the code I'm using at...
View ArticleCannot find module './App.svelte' or its corresponding type declarations
I have a setup that integrates electron with svelte along with typescript support.when I run the rollup script to compile svelte app, i am getting cannot find module ./App.svelte error as shown...
View ArticleZoom in on image and fade color overlay together on hover using Tailwind CSS
I have an image with a color overlay, and I would like to zoom in on the image while fading out the color overlay on hover. I'm working with Svelte, Tailwind CSS, and TypeScript. Fading the color...
View Articlesveltekit vite import parse error '[plugin:vite:import-analysis] Failed to...
I tried to develop a generic $lib module for my new sveltekit project.Getting this when trying to import a new module:[plugin:vite:import-analysis] Failed to parse source for import analysis because...
View ArticleDisable certain a11y warnings globally in sveltekit
Sveltekit has very strict a11y checks, for instance you can't just add on:click to a div.I can suppress it on a per-line bases, e.g.:<!-- svelte-ignore a11y-click-events-have-key-events...
View ArticleHow can I access data.user variables in lib/components in sveltekit that are...
I am using Sveltekit 4, with Supabase SSR for authentication. I can successfully access user session data from any route pages, but not from any components.Here is my src/routes/+layout.server.tsimport...
View ArticleWhy this work only using setTimeout and not normally?
I created a REPL for a strange issue.REPL: https://stackblitz.com/edit/sveltejs-kit-template-default-9zkjpt?file=src%2Froutes%2Fabout%2FCustomSelect.svelteSteps to reproduceOpen the REPLOpen the...
View ArticleThis `dispatch()` is completely ignored. Why?
I created a reproduction for an issue with Svelte dispatch not being called:Steps to reproduceOpen the reproductionOpen the browser consoleGo on the "About" page using the linkI sould see the message:...
View ArticleSvelte list crossfade randomly misplaces elements
I have a list which I want to animate so that when an item is selected, it floats to top and the rest fly out. On reselecting the element it floats back to its place and others fly back in.Using this...
View ArticleI want to get the event type of a svelte on:input event in typescript but I...
I have an input in svelte<input {type} {placeholder} on:input={(e) => emitChange(e)} class="pl-2 w-full h-full bg-sand border border-midnight dark:bg-midnight" />That goes into this function...
View Articledifference between svelte store and svelte context
What is exact different between Svelte Context and Svelte Store?When to use in different situation?import { getContext } from 'svelte';import { writable } from 'svelte/store';
View ArticleWhy isn't value assigned and cleared here?
I'm trying Svelte 5 for the first time today.This is a reproduction of this issue.As you can see if I select a date from the picker the {value} is not assigned and the same if I press the "Clear"...
View ArticleUsing shadcn-svelete , how can I preserve the state of my component?
I am embedding a svelte-stripe CardNumber element inside of a shadcn-svelte Accordion. Relevant docs:shadcn-svelte Accordion: https://www.shadcn-svelte.com/docs/components/accordionbits-ui underlying...
View Article