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

Svelte SSR: Why is writable store data being retained across multiple requests?

I am developing an application using Laravel, Inertia and Svelte. It's currently running SSR.Here's a simple code snippet that I use to set up the <title> tag in the <head> section, using...

View Article


Access svelte writable located in object

In shadcn ui port for svelte 5 - Select component (using bitsui select) bind:value asks for state(string), but Writable<string> works too as well, so bind:value={$theme or $language} is properly...

View Article


Svelte 5 and page.js routing problem with external state

I tried to use page.js for client side routing within a Svelte 5 application, but encountered a strange phenomenon: When I put the routing logic within the App.svelte component everything works...

View Article

How can I execute js when loading a sub route on a static build in Sveltekit

I never noticed this before, but I've encountered a weird issue in my Sveltekit application. To put it simply, I have a ("/map") sub route that when refreshed/loaded directly as the sub route won't...

View Article

Buy Me Coffee Script Tag in Svelte

How can i add this buymecoffee script tag in svelte. type="text/javascript" src="https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js" data-name="bmc-button" data-slug="slug_name"...

View Article


How to set break points in vsCode in a Svelte application

I am trying to debug a js file in my svelte App using vscode.The de-bugger starts correctly and the application runs. I suppose this means that my launch.json is correct.But vsCode will not set a break...

View Article

How can I set environment variables at runtime in SvelteKit?

I'm trying to run playwright tests for my SvelteKit app where I create a new database for each test suite run. I set the environment variables in a test setup file like this:import { exec as baseExec }...

View Article

How to trigger a function when there is a value change in subscribed store in...

One of my components is subscribed to a variable in a store. Whenever there is a change in that store var, I want to trigger a function.stores.js import { writable } from "svelte/store"; export const...

View Article


dynamic routing on github pages with sveltekit

I am experimenting with dynamic routing on static site hosting services like github pages. I understand that normally you wouldn't want to do this and may have to jump through hoops to get it working.I...

View Article


Flask frontend is working properly, however the svelte app inside is not,...

I have been strugling with this example https://github.com/cabreraalex/svelte-flask-example. I created a simpler example hereWhen I run the server.py, I get the template, in the source code I even see...

View Article

svelte 5 sveltekit spa object change detection

I started using Svelte-5 with Sveltekit as a SPA with Firebase.In an update form I like to detect when fields change to show buttons like commit and reset when object props change.Now I use something...

View Article

Render svelte component inside ag-grid

Does anyone have an example of how to render a svelte component inside of ag grid? Similar to how you can render an angularjs or react component inside of ag-grid.

View Article

How to implement route guards with redirects with sveltekit's adapter-static?

I have a bit of a problem with my client only app. The app works as intended during dev but the built bundle does not work as expected.Here is where I think my problem is coming from.I have hooks.js...

View Article


Image may be NSFW.
Clik here to view.

Scrolling scollbar programatically

I have created a slider component in svelte that shows a number of product cards in a list. The cards are snapping when clicking the right/left button in the scrollbar sinceI have added...

View Article

Svelte $effect rune not logging on array.push for $state rune

This is the code I'm using. Its also in sevelte5 playground here.What I don't understand is, why it's not logging when I add todo with array.push but works when I do reassignment. However, when I...

View Article


How to dynamically render components in Svelte?

I'm trying to loop through an array to render the component with the value of type.<script>import One from './One.svelte'; import Two from './Two.svelte';import Three from './Three.svelte';const...

View Article

TypeScript keeps erroring for ES-related issues despite library being...

I'm trying to write a Sveltekit application but running into errors upon compiling my TS. When it tries to compile export async function invalidateSession(sessionId: string): Promise<void> {} for...

View Article


How to compile Svelte 3 components into IIFE's that can be used in vanilla js

I am making a web component in Vanilla JS that use a hidden select in the background and a div and ul>li in front. It became a bit complex with fetching data from an api, ect, so I transitioned to...

View Article

Embedding Svelte 5 inside PHP (Imperative component API)

I'm trying to use Svelte 5 and SvelteKit inside PHP.I don't understand how to use the Imperative component API (https://svelte.dev/docs/svelte/imperative-component-api). Where do I put the following...

View Article

How to import and serve wasm.js library in Svelte with the right response...

ContextI have a Svelte 4 app whereI'm trying to use transcribe.js library: https://github.com/TranscribeJs/transcribe.js?tab=readme-ov-file#webserver, which requires that all response headers...

View Article
Browsing all 1539 articles
Browse latest View live


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