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

Does Svelte have Vue's keep-alive?

I am new to Svelte, and started building a simple app on it. I am not sure if I understood the lifecycle of Svelte deeply, but it looks like there's no option to enable this from the doc nor is there...

View Article


How do I get distinctive error logs in vite

I am trying to debug build errors that are to show when I runpnpm run build eqivalent of "vite build"But it seems that the logs generated during the build process is too ambiguous.I can't pinpoint...

View Article


npm build error with svelte: Plugin typescript: @rollup/plugin-typescript...

I am trying to build a component library with svelte. I tried to build it with:npm buildI got the error message:Plugin typescript: @rollup/plugin-typescript TS2307: Cannot find module...

View Article

Image may be NSFW.
Clik here to view.

How to make layer of different color mask on a image or a div element

here the red green and other colors on the brain image are layers of mask which means that the dead cells and difected are different. Since it is a demo image but in real images, this kind of color...

View Article

How can I mock API / Module and test this svelte Component

Within my src/lib/apis directory I have a file named data.ts which contains the below code:export async function getData(searchInput: string) {return fetch('https://dummyjson.com/products', { method:...

View Article


Svelte, JavaScript and JSDoc?

As far as I know, Svelte is written in JavaScript with JSDoc.I'd like to learn Svelte and prefer to use JSDoc. When initialising a project with npm create svelte@latest, I'm asked the following:◆ Add...

View Article

Why is my right hand expression in a reactive variable reactive?

So I have this simple Svelte code:let formValues: AppointmentWrite;$: formValues = { ...appointment}$: console.log(appointment);formValues has a property comments which is bound to an input. When I...

View Article

Image may be NSFW.
Clik here to view.

on:animationend can't access bind:this svelte (undefined)

I wanted to use querySelector() but I find that Svelte has another way to do this.by using bind:thisthe problem is that sometimes it works, but the most of time it will never workby outputting...

View Article


SvelteKit on Google Cloud Shell environment not building correctly

I'm trying to get SvelteKit working on Google Cloud Shell (using the terminal, cloud editor, and web preview feature). [Context: I'm just using Cloud Shell as a dev environment due to policies at my...

View Article


Environment variable in markup codes of SvelteKit could not work at Vercel

Hi~ I am a developer in South Korea. I am not good at english yet. But I have a question about SvelteKit.I wrote the below codes in +page.svelte as SvelteKit tutorial.This code worked well in local dev...

View Article

Open WebUI Personalization

I've finished setting up the Open WebUI with the docker and wanted to make some changes to the landing page to have it more personalized. Looking through all the files didn't really help as I'm not...

View Article

Client Upload to Vercel Blob using Svelte

I am trying to replicate the next.js code to sveltehttps://vercel.com/docs/storage/vercel-blob/using-blob-sdk#uploadIt asks for giving a path to run a server side function which I don't know about...

View Article

Svelte 5 - $derived.by not working as expected

I have following function:function createProducts(){ /** * @type {Array.<{ * id: Number, * name: String, * product: Array.<{ * id: Number, * name: String, * price: Number, * kitchen: Boolean, *...

View Article


How do I prevent page from refreshing when a from component is submitted in...

so on this page I have 2 drop-down and when submit button is clicked it is fetching data from a pocketbase backend. I am making a table component for each raw of data. (Component displays a id, link, a...

View Article

Scrolling away the Browser UI before scrolling through overflow content?

I want to have a website that has a fixed navbar at the top of my page, and the rest of the content should be scrollable.I can achieve that using this...

View Article


Quill-mention does not insert the selected mention in quill content

I am using QuillJs as an input field and quill-mention does not insert the selected mention in quill content. quillEditor = new Quill(editor, { formats: ['mention'], modules: { mention: { allowedChars:...

View Article

Linking css file with svelte component

I am trying to link css file with my svelte kit component. I used link element to link it but it did not work. If I made internal style the css style will be applied to the component but when I try to...

View Article


+layout.svelte.ts and +page.server.ts are executed twice after a FETCH is...

Using the default Sveltekit ("version": "2.5.4") demo application I have the following on the +page.server.ts:import type { PageServerLoad } from './$types';export const load: PageServerLoad = async...

View Article

Image may be NSFW.
Clik here to view.

calculator app in svelte producing wrong result with certain numbers [duplicate]

i am watching a crash course in svelte that creates a calculator app, also a beginner in javascript, when i do 1.1 x 3 it produces the result pic below but when i do 1.1 x 4 it show the correct result...

View Article

Inconsistent focus loss in sortable list

I’ve been playing around with keyboard navigation trying to build a list of items that can be sorted manually. The steps to use it are the following:Press Tab until the list is focused.Press Arrow Up...

View Article
Browsing all 1539 articles
Browse latest View live


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