6,303 questions
-1
votes
0
answers
35
views
Error "[Layer Chart] You set `yNice: true` but the yScale does not have a `.nice` method. Ignoring..."
When attempting to reproduce the punchcard graphic from LayerChart documentation, I get the following result:
Playground demo
[Layer Chart] You set yNice: true but the yScale does not have a .nice ...
0
votes
0
answers
32
views
Dynamic routes not working in Routify 3 with Vite 5 — _metaTree becomes empty after dev server restart
I’m using Routify v3 with Vite 5 and Svelte, and I’m facing an issue where dynamic routes stop working after saving code changes (Ctrl + S) during development.
{
"@roxi/routify": "^3....
2
votes
1
answer
42
views
Is there a way to exclude specific dates using Flowbite-Svelte's Datepicker?
I am working on a simple website, using SvelteKit. For the UI, I use Flowbite-Svelte and some of its components.
During early stages of development, I just used the availableFrom property. Now I want ...
1
vote
1
answer
50
views
Is it possible to short-hand forward child component exports in Svelte 5?
If I have a child component, for example Dialog.svelte, which exports some const values:
<script lang="ts">
// Just to illustrate that this is a Svelte 5 component
let { title }: { ...
1
vote
0
answers
84
views
Problem with toHaveBeenCalledWith called from window object
This is my unit test:
import '@testing-library/jest-dom/extend-expect';
import {
render,
cleanup,
fireEvent,
waitFor,
waitForElementToBeRemoved,
screen,
} from '@testing-library/svelte';
...
1
vote
1
answer
65
views
Route fallthrough with sveltekit
I am trying to create a generic API app that heavily uses the Accept header using SvelteKit. Some example routes are:
GET /[schema] - HTML page with list of {schema} items
GET /[schema] Accept: ...
1
vote
1
answer
75
views
Delaying Svelte transition until component is loaded and ready
I have a component in Svelte that I want to use a transition on.
However this component is not ready the second it is mounted (it contains a canvas that needs a few frames before fully completed), ...
2
votes
1
answer
75
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
43
views
Svelte + Routify: Carbon Pagination always resets to page 1 instead of syncing with URL
I’m building a Svelte 4 app with Routify for routing and carbon-components-svelte for UI.
I have a Pagination component that should read the current page from the URL query params ($params.page) and ...
0
votes
0
answers
82
views
Nested reactivity with Svelte $derived
I'm making a swimming app and I want a button that adds an event to a swim meet. In place of a store, I'm using an object called STATE that acts as a single source of truth for the entire app.
<...
1
vote
1
answer
167
views
How do you pass components as props?
Suppose I have a component:
//DynamicSearch
<script>
let { ..., quickAdd=false, quickAddForm} = $props();
</script>
// other forms
{#if quickAdd}
<quickAddForm />
{/if}
// Form
...
0
votes
1
answer
48
views
Call function when block is rendered inside {#if}
{#if val}
<div>Content</div>
{/if}
How do I call a function after the div is rendered?
0
votes
0
answers
56
views
How can I get a null value inside an {#if} block, that guards against null?
I have this shadcn Select component and it's supposed to bind to a value of a selected object.
{#if selectedPopup.value}
<Select.Root type="single" bind:value={selectedPopup.value....
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: ...
-1
votes
2
answers
152
views
Svelte 5: make property passed into sub-component derived based on $state/$derived/$props
I'm struggling a bit with some new concepts after transitioning from Svelte 3.
I have this component ParentComponent.svelte
<script lang="ts">
let selectedCell: Optional<Cell>...
0
votes
0
answers
51
views
Svelte Layerchart - Formatting Axis Data
I like the LayerChart for Svelte but can not figure out how to format this like the axis font style, size or color?
I am guessing it is via CSS but can not find what classes need to be formatted.
...
0
votes
1
answer
80
views
Earliest a client-side import can be executed in SvelteKit application?
Context
I have a Svelte 5 + SvelteKit application (App A) that is loaded into an iframe within a different app (App B).
When the iframe loads, App B emits a one-time message event with id=OBR_READY.
...
1
vote
1
answer
43
views
How to undo a refactor that altered base types in frontend framework?
I'm using Svelte 5 and TypeScript in VS Code.
I'm running into an issue where the TS language server thinks that the style attribute is not valid for a <div>, which is obviously incorrect. I'm ...
1
vote
1
answer
165
views
$effect running into infinite loop
I'm trying to migrate from svelte4 to svelte5 and for that I would like to change some $: to $effect. A pattern that I used from time to time looks like that:
let {id} = $props();
let thing = $state();...
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 { ...
1
vote
1
answer
106
views
Why not call a fetch function eagerly when it is not even awaited
I get this message in my terminal when running my svelte frontend:
Avoid calling fetch eagerly during server side rendering — put your fetch calls inside onMount or a load function instead
I ...
1
vote
1
answer
135
views
How to Build to a Web Component from a Svelte Library?
I'm writing a Svelte(Kit) library that currently works by importing the svelte component.
I've been requested to make it also available as a web component, i.e. something like:
<script src="...
0
votes
0
answers
229
views
Astro with Node Standalone Adapater for API - CORS issues
I'm working on a small Astro test project that uses the Node standalone adapter for an API endpoint.
Then I'm using a Svelte form to POST to that endpoint like in this tutorial.
I'm running the Node ...
-3
votes
1
answer
79
views
Is this object created only once or every time I import it? [duplicate]
Since I'm having a bug that I can't figure out, a cold doubt has assailed me:.
I have the below code in a Svelte 5 SvelteKit app.
And I'm importing import { queryClient } from './src/query.ts from ...