All Questions
Tagged with svelte javascript
2,016 questions
0
votes
1
answer
62
views
css gets transitioned at first mount
I have a svelte app that mounts some progress dots into a pretty plain html site.
simplified the ProgressDots.svelte has this:
hello
<div class="progress-dots">
<div class="...
1
vote
2
answers
82
views
How to check when window becomes available?
I am new to SvelteKit and I am not familiar with SSR. I have recently learned that window is only defined after the client-side has been loaded, which can be determined with the onMount hook.
But here'...
0
votes
1
answer
28
views
How to solve iife/umd conflict with supabase
I have installed supabase using
npm install @supabase/supabase-js
I am using Svelte and use
nvm use 16.16.0
In my script I have the line
import { createClient } from '@supabase/supabase-js'
I get ...
1
vote
0
answers
53
views
Why does Chrome black out, or crash with "aw, snap - out of memory" when there is still plenty of memory available?
I'm developing a Svelte-based Javascript single-page app with a lot of Apache ECharts displays in it that is fairly heavy in both DOM elements and array data, but generally stays in the 400-500MB ...
1
vote
0
answers
79
views
Svelte 5 memory leak in simple example
I'm encountering many memory leaks when using both Svelte 4 and 5 on reasonably complex projects, and having trouble identifying what I'm doing wrong.
Here is an extremely simplified Svelte 5 example (...
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
2
answers
49
views
Svelte input blur triggered when element is focused
Maybe its not related to svelte, but if do some DOM changes after input is focused, for example
<input onfocus={() => toggleVisibiltyOfOtherElement = true } onblur={() => console.log("...
0
votes
2
answers
77
views
Svelte 5 Unsafe State Mutation at Tree Component
I need help with Svelte components. I've built a tree that should allow users to check nodes and update related nodes. When a node is checked, its parents and children should react accordingly. ...
-3
votes
1
answer
35
views
Svelte multiple small components vs regular html elements
Does it affect performance having svelte components instead of regular HTML elements, for small things like buttons, links etc?
Wrapping these elements in a svelte component would make it more ...
0
votes
1
answer
49
views
How to display Portable Text block content images in SvelteKit
I'm trying to render a blog post from Sanity Studio in my SvelteKit project.
Currently, all of the text etc is being displayed, but images within the block content aren't. Below is what I have tried ...
1
vote
0
answers
61
views
@rollup/plugin-typescript TS2307: Cannot find module '../xxx/HelloWorld.svelte' or its corresponding type declarations
TS FILE
import App from "../xxx/HelloWorld.svelte";
const app = new App({
target: document.body,
});
export default app;
TSCONFIG.JSON
{
"extends": "@tsconfig/svelte/...
0
votes
1
answer
79
views
How to iterate over an object reactively?
I need to iterate over an object. The object is declared with:
const obj = $state({
one: { checked: true },
two: { checked: false },
three: { checked: true }
});
In my Svelte ...
0
votes
0
answers
25
views
GovUK-frontend issue: new FileUpload component with Svelte
I am trying to get the new enhanced FileUpload component in govuk-frontend 5.9.0 working in a Svelte 4 and my code looks as follows:
import {onMount} from 'svelte';
import { FileUpload } from '...
0
votes
2
answers
57
views
Make tooltip enterable/interactive
I have a tooltip component that uses Javascript to attach mouseover,mouseout event listeners to an element and on mouseover instantiates a tooltip component. I would like to make my tooltips ...
0
votes
1
answer
78
views
SvelteMap not reactive
I'm trying to use SvelteMap: https://svelte.dev/docs/svelte/svelte-reactivity#SvelteMap
but for some reason it's not reactive.
I am exporting it from a .svelte file:
export const items = new SvelteMap&...