How can I create a horizontal two-directional infinite scroll gallery with...
I'm trying to build a horizontal gallery of images, that the user can manually scroll in both directions, and will show the same images over and over infinitely.I'm using Svelte as my frontend...
View ArticleError in svelte.config.js Syntax Error: Cannot use import statement outside a...
I setting up svelte.config.js like code below:import preprocess from 'svelte-preprocess';const config = { preprocess: preprocess(),};export default config;Suddenly, my Svelte codes keep getting error...
View ArticleHow to target a component in svelte with css?
How would I do something like this:<style>Nested { color: blue;}</style><Nested />i.e. How do I apply a style to a component from its parent?
View ArticleMake tooltip enterable/interactive
I have a tooltip component that uses Javascript to attach mouseover,mouseout event listeners to an element and on mouseover instantiates a tooltip component. I would like to make my tooltips...
View ArticlePassing props to `{@render children()}`
Using Svelte 5 and SvelteKit, I need to pass props to a child while this child is integrated to its parent using {@render children()}.I don't understand how I am supposed to pass props and get them in...
View ArticleWhy my chrome extension is crashing during upload of image when Chrome is...
I am using svelte to build a chrome extension which has the ability to upload images and Post that image to instagram. Here is my project directory structure.├── .git/├── .gitignore├── .npmrc├──...
View ArticleHow to integrate Svelte in existing site
This is a successor question to How to integrate Svelte in other App Stack. The setting is the same: I've got an existing site which I'd like to extend by Svelte. The respone by @bob-fanger looked very...
View ArticleHow to integrate Svelte in other App Stack
I would like to know if it's possible to integrate Svelte for the front app with a different backend stack than the default one, with a python, Ruby on Rails or PHP server for instance?Is it possible...
View ArticleStreaming promises crashes the entire app with ERR_UNHANDLED_REJECTION when...
SetupI have an express backend server running on localhost:8000My sveltekit frontend is running on localhost:5173ProblemI shut my backend server down to see what happens on the frontendI noticed that I...
View ArticleSvelte: Expected behavior on change in phone orientation?
I have an app that uses element.ScrollIntoView(). I've been using the browser developer tools to see what it looks like on a phone. Unfortunately, I've just noticed that when I change phone...
View ArticleHow to update data without reloading the page in SvelteKit
Following the basic page data loading here is the thing. I'm not really familiar with runes, but $props are not reactive? so I can't do simple reactive just to check any changes like $:...
View ArticleLoad basic Google Map with array of coordinates in SvelteKit
I am new to web development, so also SvelteKit. I am trying to show a Google Map with markers for a list of locations. The locations come from coordinates. I have found a few similar posts here and on...
View ArticleSvelte how to wrap an on:click event in a child and await the parents function?
I'm trying to make a button component that will hide the button and display a spinner when it is clicked and is waiting for some asynchronous job to complete, and then hide the spinner and display the...
View ArticleGovUK-frontend issue: new FileUpload component with Svelte
I am trying to get the new enhanced FileUpload component in govuk-frontend 5.9.0 working in a Svelte 4 and my code looks as follows: import {onMount} from 'svelte'; import { FileUpload } from...
View ArticleHow to iterate over an object reactively?
I need to iterate over an object. The object is declared with:const obj = $state({ one: { checked: true }, two: { checked: false }, three: { checked: true } });In my Svelte templating code, I do...
View ArticleHow do I correctly validate svelte5 props with zod?
I'm new to svelte having previously worked in react and I ran into something that confused me when trying to use zod to ensure proper (runtime) typesafety of my svelte components.My typical approach is...
View ArticleTrying to load a custom .glb file but constantly getting an HTML/404 response...
Cannot work out where to put the model.glb file.Error:Error in asyncWritable: Unexpected token '<', "<!doctype "... is not valid JSON.Created the project with - 'npm create...
View ArticleUsing $env with SvelteKit and Docker
SvelteKit provides a good and easy way to use ENV variables:https://learn.svelte.dev/tutorial/env-static-publicIm using Docker in a CI pipeline to create images. However when running RUN npm run build...
View ArticleHow to monitor changes to a Svelte writeable?
Currently I have this code:File A.js:import { writable, derived } from "svelte/store";export const notify = writable(false)File B.svelte:import { notify } from '$lib/store';$effect(() => { if...
View Article@rollup/plugin-typescript TS2307: Cannot find module...
TS FILEimport App from "../xxx/HelloWorld.svelte";const app = new App({ target: document.body,});export default app;TSCONFIG.JSON{"extends": "@tsconfig/svelte/tsconfig.json","include": ["./**/*",...
View Article