162 questions
Advice
0
votes
0
replies
45
views
Automerge as svelte-flow backup
Just to prime - The following question is about understanding why automerge, indexedDB adapter and svelte-stores behave in a specific way - I'm not searching for code debug and just put the code in a ...
0
votes
3
answers
59
views
Cannot render a value from a Float32Array
I am trying to render an element from a Float32Array using Svelte.
let laterTimeIndex = hourlyWeatherData.time
.find((timeData: Date) =>
timeData.getHours() === (currentTime + 5) % 24
...
0
votes
1
answer
58
views
Is this binding_property_non_reactive really correct?
Reproduction
https://svelte.dev/playground/2c859a9c620b4b9a8422c2596df4c209?version=5.42.3
Using Svelte (v5.42.3) and Svelte Kit (v2.48.2) and @tanstack/svelte-query (v6.0.3).
If I have the component ...
1
vote
0
answers
42
views
Svelte 4 Legacy Mode Component not Rendering in Svelte 5
So I'm working on an Obsidian plugin that uses Svelte 4, but has security vulnerabilities that involve upgrading to Svelte 5 to resolve.(old ESBuild in Vite) I wanted to minimize the changes to my ...
0
votes
1
answer
122
views
How to access svelte web app variables from the browser console? [closed]
I’m working with a Svelte 5 application that has already been deployed in production, and I don’t have access to its source code. I’d like to inspect or interact with some of its internal variables ...
-3
votes
1
answer
129
views
Vite manifest not found at: .../public/build/manifest.json but the manifest.json built in .../public/build/.vite/manifest.json
When running npm run dev that works but when I stop the npm run dev and run the npm run build then go to the web site, I get the error message:
Illuminate\Foundation\ViteManifestNotFoundException: ...
0
votes
1
answer
199
views
Svelte error: effect_orphan `$effect` can only be used inside an effect (e.g. during component initialisation)
We are porting our svelte 3 based app to 5. It has a dynamic widget compilation system that allows end-users to create their own svelte widgets (see this post for background). Compilation seems to ...
0
votes
1
answer
24
views
Referencing elements inside a writable List
I have the following list of Player objects {id:number, name:string} which is a globally stored element made using writable:
// $lib/global.ts
import { writable } from 'svelte/store';
import type { ...
0
votes
1
answer
93
views
Svelte-flow async integration with indexedDB
Context
I'm using Svelte-Flow with Sevelte 5 for some project. To scale I want to have the object defining my node pushed to indexedDB. To keep it in sync and don't dodata handling twice, I want to ...
1
vote
2
answers
86
views
Conditional typescript in this component
I have this Svelte 5 code:
<script lang="ts">
type BaseProps = {
required?: boolean;
};
type SingleDateProps = BaseProps & {
range?: false | undefined;
...
0
votes
1
answer
93
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
0
answers
50
views
svelte-clerk library sign-up user does not recieve verification code
It works normal as it should when a user signs up via Google or Facebook, but when it's just email the user gets redirected to /sign-up/verify-email-address, which I have not set up and the user does ...
0
votes
1
answer
61
views
.env files in production using adapter-node (pre-built application)
I am trying to deploy a sveltekit app using adapter-node using .env files.
I have a .env file with several values:
V_TEST1=TEST1
PUBLIC_V_TEST2=TEST2
I access them using import { V_TEST1 } from '$env/...
0
votes
2
answers
109
views
Reactivity and exported state-using function
App.svelte:
<script>
import Comp, {getValue} from "./Comp.svelte";
const derivedValue = $derived.by(getValue);
</script>
<Comp />
<p>
<span>App: ...
3
votes
1
answer
366
views
How to mock page from $app/state in SvelteKit + Vitest unit tests?
this is my first post — I'm new to both Stack Overflow and SvelteKit. I'm trying to test a Svelte 5 Navbar component that conditionally shows links/buttons based on:
page.data.user — if the user is ...
0
votes
0
answers
102
views
Returning an array from server-side to client-side in Svelte 5
I am using Svelte5. When I send an array from +page.server.js to +page.svelte it always works server-side and the array is sent as expected. However when +page.svelte is running on the client side ...
1
vote
1
answer
122
views
How to invalidate an arbitrary cache?
I have a simple +page.ts showing the data string and providing the "Update" button:
<script lang="ts">
import { invalidateAll } from '$app/navigation';
const { data }...
1
vote
1
answer
536
views
How to properly handle async initialization in Svelte 5 without onMount?
I'm migrating my project from Svelte 4 to Svelte 5, and one major pain point is the removal of the traditional onMount usage for async logic.
In Svelte 4, I used onMount(async () => { ... }) to ...
1
vote
0
answers
127
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
37
views
Why doesn't Svelte record signals individually?
I'm wondering about internals of Svelte to properly design my application to have maximum efficiency (I may deal with (tens?) of thousands of elements to update, so efficiently does matter), notably ...
0
votes
1
answer
60
views
Open-props breaks default Svelte alignment
If I scaffold a new Svelte v5 project
npm create vite@latest myapp -- --template svelte
Then import the Open-props stylesheets in the main App.svelte file
:global {
@import "https://unpkg....
0
votes
0
answers
71
views
@rollup/plugin-typescript TS2307: Cannot find module or its corresponding type declarations
main.ts file
import App from "../components/HelloWorld.svelte";
const app = new App({ target: document.body, });
export default app;
rollup.config.json file
import svelte from "...
0
votes
0
answers
73
views
Streaming promises crashes the entire app with ERR_UNHANDLED_REJECTION when backend is not reachable.How to handle errors on streaming promises?
Setup
I have an express backend server running on localhost:8000
My sveltekit frontend is running on localhost:5173
Problem
I shut my backend server down to see what happens on the frontend
I ...
1
vote
1
answer
189
views
Svelte onMount method does't wait for await
I have Firebase app with Svelte 5. Svelte is '5.17.5', @sveltejs/kit is '2.15.3', firebase is '11.2.0', vite is '6.0.7'. Here is method, it doesn't stop on await/async. What am I missing?
Here is ...
0
votes
1
answer
101
views
SvelteKit issue with header not refreshing
Given this +layout.svelte:
<div class="app">
<Header />
<main>
{@render children()}
</main>
</div>
if I do a goto in a component, the ...