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

How do I get my sveltekit websocket ws to work on IIS?

I am trying to get my sveltekit websocket app to run on IIS on my server running Windows server 2022. I cloned the project form this repository which uses the node ws library. After I build the project...

View Article


SvelteKit page data doesn't always update when opening new page in the same...

I have a route structure /items/[category]. When the user is browsing /items/category1 and then tries to go to a another page in the same route (eg. /items/category2) the page data usually updates to...

View Article


localhost:5000 Working In Firefox But Not Chrome, Safari, And Edge

I've been trying to follow the "Svelte for new developers" blog article on Svelte's website to set up a new Svelte project.After carefully following all of the instructions and running npm run dev, I...

View Article

Unit tests for async url parameters in Svelte and Jest

In Svelte onMount I'm doing following logic.onMount(async () => { projectId = await new URLSearchParams(window.location.search).get('p'); jobId = await new...

View Article

Why can the $state rune not handle a boolean condition ($effect needed)

I am a bit confused as to why the $state rune cannot handle a boolean condition. Why is that something that requires a separate rune, in this case $effect? In the Svelte documentation, they put an...

View Article


SvelteKit: how do I do slug-based dynamic routing?

I am a newbie on Svelte and in coding in general. I'd prefer to learn SvelteKit (Svelte@Next) rather than sapper since that seems to be where Svelte is heading.For my personal project, I need to...

View Article

I can't create a Svelte project

Important: Before writing this message I made sure I was using version 20.18.1.I try to create a Svelte project using CLI.I have a problem with Node but I don't understand.My default and use Node...

View Article

Svelte 5 - Uncaught ReferenceError: $state is not defined

I am trying to make Svelte 5 project (I know it is still in alpha, but I want to play a bit with it), and I am using this as a template for nowMy App.svelte<script> import { withPrevSignals }...

View Article


difference between svelte store and svelte context

What is exact different between Svelte Context and Svelte Store?When to use in different situation?import { getContext } from 'svelte';import { writable } from 'svelte/store';

View Article


Statement rerun unnecessarily

I have some strange things happening on my svelte code, here are the simplified version of my code+page.svelte<script lang="ts"> import { writable } from 'svelte/store' import Provider from...

View Article

How to go to .svelte component on control + left click instead of type...

I'm using a monorepo with an npm workspace used as a global library.When using components from this library, when I control + click (on VSCode) on one of them (.svelte component) on the import, it...

View Article

Svelte 5 bind value is getting more complex

I migrate my progect to svelte 5 and start using the power of runes but the code is buggy because the bind is not working anymore and i had to add some extra line of code. Here and example before and...

View Article

Why are my import types not resolving correctly?

I'm using VS Code v1.95.3 on an M2 mac, running a SvelteKit TS project and I'm trying to understand why the type of my imports does not resolve correctly.During form validation I created a Zod schema...

View Article


$bindable and propagation don't seem work

I'm building a nested tree of objects. This is the structure: ID: string; indexes: number[]; title: string; validated: boolean; column: DescriptionElement[]; children: Paragraph[];I want to create a...

View Article

I'm getting an error in "Serverless Function" in my SvelteKit Project often

I don't know why I'm getting this error sometimes.504: GATEWAY_TIMEOUTCode: FUNCTION_INVOCATION_TIMEOUTI'm using the load function to fetch the posts on the index page.<script context="module">...

View Article


Antivirus catches “CVE-2024-4577” vulnerability even though there is no php...

I have a web project with Svelte and the antivirus application throws such an error even though there is no php related code block in it. Under node_modules, there is only one php file in the “flatted”...

View Article

Animate height resize on container with dynamic content

I am new to svelte and I was playing with the svelte/animate and svelte/transitions modules. The main question is how to animate container height when new content is added/removed.I was trying a few...

View Article


Image may be NSFW.
Clik here to view.

eslint (with types) + svelte v5 fail?

seems like something is perhaps broken using svelte v5 with eslint rules (with type checking enabled):(start with minimal app e.g. npx sv create foo (typescript + eslint))minimally change...

View Article

Image may be NSFW.
Clik here to view.

How to implement search engine results with rich links like Login and Signup...

I noticed that some apps display enhanced search engine results, where additional links like "Login", "Signup", "Pricing", etc., appear directly below the main link when searching for their app (see...

View Article

Reactivity in $effect goes away if I remove a console.log()

I have a $state with an array:let clicks = $state([])I have an effect, which references the clicks state:$effect(() => { // Box selection if (autoDetectSettings.value.mode === 'box'&&...

View Article
Browsing all 1539 articles
Browse latest View live


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