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

BottomNavigation component in svelte native

I'm currently working on integrating a BottomNavigation component into my Svelte Native application and encountering some difficulties. It appears that BottomNavigation was deprecated from the core...

View Article


How to use an array from a JS file to a Svelte file

I have a function in a +page.js file that return { props { data } }. Data is an array. However when I try to use it in svelte withexport let dataIt says that it's not an arrayWhat should I do ?

View Article


SvelteKit SuperForms message always undefined

I am developing a form with Sveltekit, sveltekit-superforms, drizzle, zod schema to be able to perform server-side checks of the form, the problem subsists in the fact that after performing the checks,...

View Article

Svelte5 and Bootstrap5

I have recently been getting into Svelte and really like it. It's my first framework with the binding stuff, and I have been enjoying just working on some personal projects with it.However, I am having...

View Article

How to disable Svelte warning "Unused CSS selector"

The approach of my graphic designer for formatting our Svelte application is having a systematic set of classes in LESS, importing the appropriate LESS file in the component or page, and then applying...

View Article


API Fetch Request Works on Desktop but Not on Mobile – CORS or HTTPS Issue?

I'm building a Svelte app that fetches random quotes from an API (https://zenquotes.io/api/random). The app works perfectly on desktop browsers but fails to fetch data on mobile devices (both locally...

View Article

Is it possible to animate a radio button on selection change without using...

I'm making a selection bar for an app by using heavily styled radio buttons so I can make sure there can just be one element selected at a time and also using handy styling tricks so I had to code...

View Article

What is the proper way to integrate MySQL in Sveltekit?

I am struggling with integrating node-mysql2 into Sveltekit. As soon as the connection goes idle I get an 'ECONNRESET' error and my application freezes until the page is reloaded.Below is my db.ts file...

View Article


Dynamically compile .svelte source code to a view (REPL-like component)

Dynamically compile .svelte source code to a view (REPL-like component)I'm building a REPL-like feature in my SvelteKit app, where users can input .svelte code, and it gets dynamically compiled and...

View Article


Why do I need to use the "type" keyword when importing types in Svelte?

I'm coming from the React world, and I'm trying to learn Svelte 5.Suppose I have the following file:// types.tsexport interface Person { name: string;}In React, I can import the Person declaration...

View Article

Svelte Replace element in each with both in:{...} and out:{...}

I have a list of elements and would like to animate when this list changes. Some items might be removed, some added, some stay the same in either the same or a different position.My thought was that I...

View Article

Dynamically access local data elsewhere on the server with sveltekit

On the server that my website runs off of, I have a JSON file located in /srv that updates every day with new data that I would like sveltekit to read every time the page is loaded.//import latestVid...

View Article

Svelte 3, async onMount or a valid alternative?

What I need is to use async-await in Svelte onMount().Or maybe you can suggest me what is wrong and what I can use alternatively.To Reproducego here:...

View Article


export typescript type in svelte file

I want to export the type that I defined in one of my files and import it inside another file.export type myNewType = {name: string};linter show me bellow error when I add export:Modifiers cannot...

View Article

Typescript not parsed in Svelte html section

I'm working on a Svelte project, configured to use typescript.For every element in the datesToShow array, a div should appear in the DOM. This is done with the code shown bellow.{#each datesToShow as...

View Article


Dispatch event from child to grandparent in Svelte

The structure of my application is as follows:Grandparent is a formParent is an input which calls an apiChild displays the results of the api callIn the child component I want to pass data up to the...

View Article

Svelte5/SvelteKit2 - $page.data vs let data: LayoutData = $props() in...

It appears to me, that the data set by the return of an outer (for example the global) layout.server.ts file is accessible in two ways by it's children and nested components:// outer...

View Article


Error when importing svelte.ts into a .svelte file

I'm working on an Svelte application and trying to setup a rune "state" storage in its own separate file so it can be reused, but when trying to import on a .svelte component, I get a compilation...

View Article

Applying style variable with TailwindCSS in Svelte 5

I am having confusion while applying style variable with TailwindCSS in Svelte 5.This works:<script lang="ts"> interface Props { rows: number; columns: number; size?: number; padding?: number;...

View Article

Basic Playwright setup not working in Sveltkit

When i run npm test after timeout i get these results:Running 0 tests using 0 workers[Webserver]... some unused css selectors messages[WebServer]Error: Timed out waiting 60000ms from config.webServer.I...

View Article
Browsing all 1539 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>