135 questions
-1
votes
1
answer
27
views
passing children's layout.ts data to parent's layout.svelte
So I have been working on the implementation of breadcrumbs feature in my sveltekit webapp.
The idea is, the breadcrumb will be rendering at the most top layout.svelte.
And then the proceeding ...
0
votes
0
answers
38
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 ...
0
votes
1
answer
26
views
Declare a snippet inside a component without it being implicitly passed to the component as a prop
The Svelte tutorial demonstrates how to declare a table row snippet:
<tbody>
{#snippet monkey()}...{/snippet}
{@render monkey()}
</tbody>
So far so good. Makes sense to put a ...
1
vote
1
answer
35
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 }...
0
votes
1
answer
23
views
Using IntersectionObserver breaks SvelteKit prerender, which results in 404 on direct urls
I have a static site that I deploy to GitHub pages (GHP). I first build it locally and then deploy the output to GHP. Which is why all the data is in JSON files that are updated and deployed when eg. ...
0
votes
1
answer
48
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
votes
0
answers
19
views
Svelte 5 snippet argument type check weird behaviour
I've had this problem for a while and haven't really found anyone with a similar issue. The Svelte 5 snippets do not accept primitive types as arguments.
.
I have the script tag marked with lang="...
0
votes
0
answers
32
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 ...
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
21
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 ...
-1
votes
0
answers
33
views
Svelte (vite?) installing static resources
How can I make static resources (e.g. fonts/images) in a node_modules package available in a Svelte application?
I'd like the process to be automatic so you don't have to do anything manual if you use ...
0
votes
0
answers
43
views
Astro + Svelte: Imported Svelte Components Have No Type Checking in VSCode
I'm using VSCode, and I've noticed that when I import Svelte components into my Astro components, they are typed as any, and TypeScript does not type-check the props.
I have set up my project running:
...
0
votes
1
answer
33
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
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. ...
0
votes
0
answers
40
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 "...