555 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
81
views
Svelte barrel/index file throws TypeError "Cannot find module..."
I'm trying to re-export icons from a single barrel file in Svelte, specifically in SvelteKit, as discussed in this GitHub issue.
However, when I try to do this, I get the following error inside index....
2
votes
1
answer
117
views
Svelte 5: Typescript and rest props issue "'prop' is specified more than once"
I have component <Component> which is basically an instance of another component <Modal> (a modal used for a specific action).
For consistency and improved legibility I am passing all the ...
0
votes
1
answer
93
views
SvelteKit use prop for background-image [duplicate]
I am using SvelteKit and I have a component that displays a CSS background-image - see picture. I have this working with a hard-coded image but I need to vary the image from card to card.
Here is my ...
0
votes
1
answer
111
views
How i can manage a component that needs to use a custom event?
I’m using a custom Select component inside a table, and I want to make some reactive calculations in the parent component for example, updating the total price when a discount is selected through a ...
0
votes
1
answer
159
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?....
1
vote
0
answers
138
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
45
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
100
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
63
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
93
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
619
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 = $...
2
votes
2
answers
2k
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
60
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
183
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
42
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 ...