Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Browsing all 1539 articles
Browse latest View live
↧

Not able to run puppeteer with Svelte, internal error 500 when I import...

I have made a new project using the following command:npx degit sveltejs/template svelte-appI have followed this tutorial:...

View Article


Caching images fetched from API in the Svelte build folder using static adapter

I typically use 11ty as a static site generator, but I'm trying out Svelte for more interactivity on a site I'm developing now. I'm using Strapi as a CMS in a logic that I've used with 11ty before:...

View Article


SvelteKit: Is there a way to create multiple GET endpoints in a single...

This is an example of what i'm trying to achieve... I'm wondering if there is something like this in sveltekit without creating a separate file to handle the "GET_2" endpoint.// +server.tsexport const...

View Article

How do I use shoelace.style icons in svelte?

I can use e.g. the sl-switch tag by following the shoelace.style docs (https://shoelace.style/components/switch):<script> import '@shoelace-style/shoelace/dist/themes/light.css'; import...

View Article

Svelte 5 Best Practice for passing reactive primitives across...

I have a few dozens of reactive primitive values (like e.g. div_status = "frozen") which I need to pass between component/module boundaries, including +page.svelte files and svelte.js modules. These...

View Article


How to make a popup with a slider to use inside a Svelte component?

I'm making a web app in which I'd like certain click events to pop up a dialog with some text, numbers and a slider.My App.svelte has plenty of things in it, text, images, junk, stuff, and some Svelte...

View Article

Svelte 5: Best practice to pass primitives reactivly across...

Update: I have rewritten my question here: Svelte 5: How to pass primitives reactivly across components/modulesOld questionI have a few dozens of reactive primitive values (like e.g. div_status =...

View Article

How to use a custom svelte element with typescript?

I want to use svelte:element as label and set the "for" attribute. then I get a ts error message, that '"for"' does not exist in type 'HTMLAttributes'How can I type the svelte:element correctly?ts...

View Article


Svelte 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 Article


Why aren't rune enabled transparently with the old syntax, and when not to...

Svelte 5 introduce runes, and recommends now to write:let foo = $state(42);instead of the elegantlet foo = 42;I can understand why it makes sense in React… but since svelte is a compiler, why can't it...

View Article

Svelte 5: How to pass primitives reactivly across components/modules

I have a few dozens of reactive primitive values (like e.g. div_status = "frozen") which I need to pass between component/module boundaries, including +page.svelte files and svelte.js modules. These...

View Article

Why different outputs of dynamic route in svelte (simple)?

Actually I am a noobie in web development so what I need was why when I try give the IDas $page.params.ProductId it gives the correct product ID<script> import {page} from '$app/stores'; const ID...

View Article

How to prevent redundant data fetching script (application/json) in static...

I'm using SvelteKit to build a static website with the static adapter for server rendering. I've noticed that in the generated HTML files, there's a script that fetches the same data that's already...

View Article


Svelte - {#each} {/each} generating unique ids in an object passed down to...

I want to generate a list of custom components , composed of an input field and a few checkboxes:<script>const messages = [ { id: "2fzae4", text: "aaaaa"}, { id: "456ndr", text: "bbbbb"}];const...

View Article

Logic issue 3 slides and 4 images to show - Svelte or js/html/css

i have the following logic problem im not being able to solve. i have an image slider that has 3 slides and 1 in the middle (checked == true). I need a logic that handles the following...

View Article


Splide Svelte customize pagination or any splide element in svelte component

I am trying to use Splide in my Svelte aplication and I want to change where the pagination appears, since it is on top of my images and too transparent. I'm using Svelte Splide to implement this...

View Article

How can I animate move from one svelte-dnd-action dndzone to another using a...

I have a parent component that has 2 children. Each child has a dndzone in it. With each child I am passing an array of objects. I have two arrays of objects, "pickPlateIds" and "quePlateIds". Each...

View Article


How do you load and use a custom font in Svelte

I know it probably uses @font-face but I dont know where to put my woff files localy to get Svelte to use a custom font. I dont know where to put the @font-face either. Thanks in advance!

View Article

I have a question about the svelte radio component

Radio components are being made and used.However, the input tag cannot be found because the parent page onMount runs earlier than the logic in the component.Is there any way to disable onMount on the...

View Article

Image may be NSFW.
Clik here to view.

Firefox - Clicking a button also clicks the underlying div

I noticed that only in Firefox and only when clicking one button (the settings one), the border of the div becomes white. This isn't a problem on computers, but on mobile that is detected as a touch,...

View Article
Browsing all 1539 articles
Browse latest View live