Svelte 5 snippets parameter 'x' implicitly has an 'any' type
After upgrading to Svelte 5, I tried the new {#snippet ...}. I am getting this type errors, but in the svelte docs it is like they do not exist for them.{#snippet NavLink(href, text)}<a...
View Articleeslint-plugin-tailwindcss configuration not working
I'm having trouble putting the tailwind css plugin for eslint to work... I'm using sveltekit, not sure if that is relevantI've tried everything I know and could find online...the eslint.config.js...
View Articlerun sveltekit dev with https
Is it possible, in development env, to run SvelteKit app with https?I tried to runnpm run dev -- --https and vite starts the server successfully:VITE v3.0.2 ready in 359 ms➜ Local:...
View ArticleHow to add a submenu to my dropdown in svelte
I'm working on a svelte project where I have a top bar with a few menus. When I hover over the menus a dropdown will appear below with some menu items. Some menu items have subitems that I want to...
View ArticleSvelte 5 and this is undefined
Why I have for this input undefined? Type something and press tab or enter. Svelte is v5.1.3 and I am sure that something is missing..https://t.ly/d1UbN<script lang="ts"> let abc11=$state("");...
View ArticleHow do I use $state inside hooks.client.ts?
I'm trying to implement authentication with Pocketbase and Svelte 5, following this repo.In $lib/stores/user.svelte.ts I'm creating a $state store (not sure how to call it?)://...
View ArticleHow to dynamically render components in Svelte?
I'm trying to loop through an array to render the component with the value of type.<script>import One from './One.svelte'; import Two from './Two.svelte';import Three from './Three.svelte';const...
View ArticleHow to load local fonts in sveltekit?
trying to use these fonts in sveltekit but not working, other fonts seem to be working, it should work I tested them using in nextjs app by loading with localFont(nextjs specific) so this fonts are not...
View ArticleHow do you integrate AI tools like ChatGPT or Copilot into your coding...
I’ve been using ChatGPT since its release, primarily for Laravel, Svelte, and React, and usually stick to the desktop app. My workflow goes something like this:I brainstorm the feature I want to...
View ArticleDifference between Svelte and SvelteKit static adapter?
I have two projects here:Created using npm create vite app-with-svelte -- -t svelte-tsCreated using npm create svelte app-with-sveltekit (Skeleton project)Then, I use the static adapter with it,...
View ArticleWhat's the proper way of creating a custom element/web component for...
Tried creating a web component/custom element that would wrap a table from tabulatorjs using svelte, but for some reason can't get the table to properly display. I've followed the docs text and it...
View ArticleStruggling with successfully typing ActionResults for form actions in...
I'm trying to return the created object from a POST request to the page. Everything works, but the Svelte Vite dev server (which is running) seems to not be comprehending the types properly, resulting...
View Articlesvelte $state considered undefined by eslint?
My code runs fine which makes me think it comes from the linter. Also, when I close the file in VScode it's green, but when I open it it goes red. in my shared.svelte.js file:Here are the dependencies...
View ArticleBuilding Sveltekit for cloudflare pages getting TypeError
I am trying to build my static website via vite build with the cloudflare adaptor.My package.json is the following:{"name": "my-website","version": "0.0.1","private": true,"scripts": {"dev": "vite...
View Articlefetch asynchronous data svelte
basic backgroundI am designing an anonymous board using Svelte 4, now I have a route routes\board\[board_url]\ which has +page.server.js and +page.svelte. In +page.server.js, I will get information...
View ArticleHow to resolve concurrent dependency change?
So let's say I have these variables ($: marks a reactive statement, so when any of the values after = change, the variable is updated):let x = 0;$: y = x;$: z = x + y;function...
View Articlevitest and svelte component's onMount
I'm trying to use Svelte to create a simple reactive component. The component loads data from an api server onMount and updates a reactive value (which updates a html element).I have a simple vitest...
View ArticleHow do we do "named slots" in in Svelte 5?
Svelte 5 Slots are ConfusingNow, with Svelte 5 at pre-release, I feel I can express some confusion about slots in Svelte 5. In Svelte 4, slot and names slots where done in the following...
View ArticleType for Components Passed as Props in Svelte 5
Let's say I have a parent component called SplitView.svelte:<script lang="ts"> import type { Snippet } from 'svelte' type Props = { master: Snippet detail: Snippet } let { master, detail }: Props...
View ArticlePlaywright test fails because of Mapbox and LineAwesome
I have a Svelte application that interact with Mapbox-gl and Line-Awesome. I'm defining a test suite for that using Playwright. My playwright configuration is:import { defineConfig } from...
View Article