554 questions
0
votes
0
answers
102
views
How to have regular code work with proxies
I have a derived variable from a property of a svelte component:
let {entity = $bindable(), targetType}: { entity: EntityDTO, targetType: EntityType } = $props();
const links = $derived(entity.links?....
0
votes
0
answers
33
views
Svelte Routing - Cannot read properties of undefined (reading 'before')
Not able to get routing to work without a bug. The route works if I click on the link twice, the second time, the correct page renders. The first a console output error is generated.
ERROR:
Uncaught ...
0
votes
1
answer
28
views
Parameters in svelte action not reactive
Svelte action that does things when keys are pressed:
import type { Action } from "svelte/action"
export const keys: Action<HTMLElement, boolean> = (node, active?: boolean) => {
...
0
votes
1
answer
86
views
Why my chrome extension is crashing during upload of image when Chrome is maximised?
I am using svelte to build a chrome extension which has the ability to upload images and Post that image to instagram. Here is my project directory structure.
├── .git/
├── .gitignore
├── .npmrc
├── ...
0
votes
1
answer
36
views
Convert component inheritance syntax to Svelte 5 function component
I am migrating my codebase from Svelte 4 to Svelte 5.
I had the following code:
import MarkdownLinkRenderer from '$lib/MarkdownLinkRenderer.svelte';
export function createMarkdownLinkRenderer(styles: ...
0
votes
1
answer
47
views
Export function from Svelte component
Component.svelte:
<script>
export function test(){
return "test";
}
</script>
App.svelte:
<script>
import { test } from "./Component.svelte" // error;
...
0
votes
2
answers
121
views
Svelte child component props doesn't update on parent state change
Parent component:
<script>
import Child from "./Child.svelte"
import { onMount } from "svelte";
import apireq from "./api.js";
let items = $...
1
vote
2
answers
505
views
Other than children(), can I import and render multiple snippets in +layout.svelte that are defined in +page.svelte?
New to SvelteKit and trying to figure this part out...
Here's a couple of ways I was trying to achieve this, but the sidebar either doesn't load, or the navigation appears twice for some reason; with ...
0
votes
0
answers
18
views
How to import a svelte.ts component from another app where the import is with $lib
Hi im trying to import a svelte component from another svelte.ts app. This component has a script:
button.svelte:
<script lang="ts">
import { cn } from "$lib/utils.js";
...
0
votes
1
answer
80
views
How to disable svelte-check error in HTML part of Svelte component?
I have a component written in Svelte 5, using $props() rune.
LogActions.svelte
<script lang="ts">
//@ts-expect-error
let { onSave }: { (): void } = $props() ;
</script>
<...
0
votes
0
answers
31
views
Cant seem the send data to certain group SignalR
Sending information to specific groups is not working
For a school project is was trying to send data to my frontend im working on. However when i try to do that i receive notting. When i change from ...
0
votes
1
answer
201
views
How to Wrap Each Child with a Tag in Svelte 5?
In Svelte 5, how can I wrap each child with a tag like the example below?
{#if children}
{#each children as child}
<button
onclick={() => {
handleClick();
}}
>
...
0
votes
1
answer
84
views
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 ...
0
votes
1
answer
714
views
How to bind a component instance in a type-safe manner in Svelte 5?
I'm following the tutorial provided by the Svelte team in their website!
There is this section in the tutorial that basically explains how we can expose certain functionalities from a custom component:...
0
votes
0
answers
127
views
How to add a submenu to my dropdown in svelte
I'm working on a svelte project where I have a top bar with a few menus. When I hover over the menus a dropdown will appear below with some menu items. Some menu items have subitems that I want to ...