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

Got error "Function called outside component initialization" when testing...

I want to test the following Svelte component with Vitest:<script context="module"> import {push} from 'svelte-spa-router' import {onDestroy} from 'svelte' let time = 1000*120; let interval =...

View Article


How can I create a route alias in solidstart's file routing and keep layout?

I'm trying to wrap my head around how to best do nested layouting using SolidStart's file based routing. I have an old app with a "route alias" from "/" to "/some/nested/page/with/layouts". I'm trying...

View Article


Svelte custom event on svelte typescript

I'm using clickOutside directive on my svelte-typescript project and I'm getting this error when I assign custom event to the related elementType '{ class: string; onclick_outside: () => boolean; }'...

View Article

How can I pass parameters to on:click in Svelte?

Binding a function to a button is easy and straightforward:<button on:click={handleClick}> Clicks are handled by the handleClick function!</button>But I don't see a way to pass parameters...

View Article

Multiple fetch requests NOT executed in async on Chrome on Windows

I am developing a simple website using Svelte, with a frontend server in Svelte and a backend server in NestJS. Currently, I'm working on my local machine.The issue:I am sending a request from my...

View Article


Why is a comma (,) being added to the questionIndex when I am using it again...

I have two components, Question.svelte and QuestionList.svelte. The Question component has a clear button which will clear the selection of its options, which are radio buttons. The QuestionList...

View Article

Image may be NSFW.
Clik here to view.

Vite+Svelte build output runtime error (syntax error)

When running build I encounter (in around 60% of time) syntax error in compiled output:Error of this kind does not appear always.. it would usually require to restart build process several times to get...

View Article

how install Svelte framewoek with Rails 6+ and Sprocket (no webpack)

I have a Rails 6 app and I want use Svelte on client side onlyI have nodeJS, NPM and Yarn installed.Now, how can I install Svelte to this app without webpack, only using sprocket ?

View Article


How to share custom data in Capacitor Background Runner

I'm building my first app with Capacitor 5.4 and Svelte 3.49. The app is going to send notifications based on a remote API, it is fetching periodically an endpoint and based on the last API activity it...

View Article


Image may be NSFW.
Clik here to view.

html variable content does not get styling with svelte [duplicate]

I need to dynamically add html content with the use: statement. My problem is that when adding content to innerHTML the content is not correctly styled.<script> const applyHtml = async (node)...

View Article

Styling dynamic HTML via in-component tag (Unused CSS selector)

I am trying to add some styling to an HTML tag rendered inside of the {@html...} tag of a Svelte component, but it appears that it only inherits the parent's styling (the container of the {@html...}...

View Article

How to drag a clone with Svelte5 and interact.js

I'm using interact.js and Svelte 5 (version 5.0.0-next.200) to drag an element which initially sits inside a scrollable div and must be dropped outside of that div. To make this work I need to clone...

View Article

svelte config custom path for app.html does not work

Im restructuring my project (website). Now it has:src/frontend/...src/backend/...I changed my svelte.config.js to have the specific path:files: { appTemplate: 'src/frontend/src/app.html', },But I still...

View Article


Deep links in SvelteKit SPA embedded in a django CMS website

we have the following situation: Two Django based projects (not my plan to have them separated, but for now it is like that) on the same VM on a self administered system: One project has the data, and...

View Article

How can Update the data form with the inertia.js formHelper in Svelte?

I have a big form with several inputs to inscribe a student, And when the user types the DNI of one of the parents I make a request through Axios, and if the DNI already exists in the database then I...

View Article


Vite refuses to use the correct build target in my Svelte / TS project

I'm creating a website using THREE.js, Svelte, Typescript and Vite. When I tried to test a new THREE.js feature (WebGPURenderer), I got the following error in the build step:[ERROR] Top-level await is...

View Article

The background becomes black when I add DaisyUI in my SvelteJS+Tailwindcss...

I was configuring with my SvelteJS and Tailwindcss project with DaisyUI. But every time I add DaisyUI to a Project the background color becomes black. Maybe it's a default color that's not the problem....

View Article


How to make a fetch request everytime a prop changes in a component in Svelte?

Script part of a simple component, this component receives an id from its parent which triggers a fetch request based on that id. Problem here is that the component only mounts once and therefore,...

View Article

Svelte print contents of a div element

Hi I'm using svelte for a side project i am doing and i want to print a receipt and not the entire page. is there a way to do it? i saw some other posts talking about how to print a div element using...

View Article

Dynamically populating the drop down with new labels [duplicate]

I'm tring to implement a dynamic drop down list which will include new items added to some list by, for example, clicking some button.I have the following code snippet that illustrates the mechanism,...

View Article
Browsing all 1539 articles
Browse latest View live