svelte working with HTMLObjectElements seems.. buggy?
i need to embed an svg element in my svelte project.i am trying to do it like this:<script>let svg_path =...
View ArticlelocalStorage.setItem not using the value of the array I am setting it to in...
I am trying to set an array in my local storage based on which version of an item is open. nearly this exact logic at the top level works perfectly fine upon page load. this function runs when a user...
View ArticleSvelte 5 custom dispatch Object literal may only specify known properties
I am trying to create a simple dispatcher but I keep getting error that it doesnt recognize the dispatcher that i am creating.function dispatchChange() { dispatch('treeChange', { id: field.checkbox.id,...
View ArticleHow to display a package.json version in the footer of the site?
I would like to display a version that is declared in the package.json file in the footer of my siteHow can I do this?I found this FAQ explanation in their documentation, but unfortunately I don't know...
View ArticleTypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module "package.json" needs an...
There are no errors when launching the application, and the application functions normally, but if you log in to the server logs, a permanent error appears.Error in the logs:2024-03-23_04:59:51.32690...
View Article'Buffer' is not exported by __vite-browser-external:buffer
I'm getting this build error with vite and sveltekit using adapter-nodeI'm not sure why it won't build since it relies on node to server the client.dev works fine'Buffer' is not exported by...
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 ArticleHow to pass a table data (which is in SQLite) to Svelte page through Flask
I use command to create a svelte project named "table-test". Commands: npm create svelete@latest then npm install.The initial page works fine. I add a "table" folder under router then add three files...
View ArticleHow to create infinite image slider using Tailwind in Svelte?
I'm trying to create a following image slider in Svelte using Tailwind:I have created a sample array: let carouselFilters = [ { id: 1, name: 'Urban & Cityscape', img:...
View ArticleSet `body` `background-color` programmatically in Svelte?
I'm making a site using Svelte and SvelteKit, and I'd like to use a predefined array of colors for styling in a normalized way-- if I change one of the values later, everywhere that styles using that...
View ArticleSvelteKit: disable SSR
I made an app in Svelte and now I wanted to port it to SvelteKit. My app uses window and document objects, but those aren't available in SSR. Firstly, it threw ReferenceError: window is not defined,...
View Article"This comparison appears to be unintentional" error, why?
I don't know how to reproduce the following in the svelte-5 REPL because it doesn't recognize enum from the same file:<script lang="ts"> enum Pro { ZERO, ONE, TWO } let pros: Pro =...
View ArticleAstro, seeing `X [ERROR] The build was canceled` in build output (npm run build)
I'm seeing the following the following error in the console logs on npm run build ("build": "astro check && astro build"). The build actually completes following this, but I don't like not...
View ArticleSvelte crossfade animation only works when imported from different file
I am using a crossfade animation in svelte, but If I directly implement the logic in the same page(like below) the fallback animation will trigger(which is not expected behavior). But if I put the...
View ArticleCSS Gradient Animation Not Working in Svelte Component
I'm working on a Svelte component where I want to create a shiny call-to-action button with gradient animations. The button should have a combination of linear and conic gradients that animate over...
View ArticleSvelte list crossfade randomly misplaces elements
I have a list which I want to animate so that when an item is selected, it floats to top and the rest fly out. On reselecting the element it floats back to its place and others fly back in.Using this...
View ArticleHow to Replace Deprecated with {@render} in Svelte 5 for Nested Components?
I'm currently upgrading from Svelte 4 to Svelte 5 (using SvelteKit), and I'm encountering an issue when trying to replace the deprecated <slot /> with {@render} in my components.I'm looping...
View ArticleSvelte components with generics
I want to use a generic type in a Svelte(Kit) component's props, and I found out there is this type T = $$Generic thing:<script lang="ts"> import type { Writable } from "svelte/store"; type T =...
View ArticleUniversal rendering skeleton Loading in sveltekit
I'm working on a SvelteKit project where I aim to achieve universal rendering. My goal is to have the first request be server-side rendered (SSR), and then switch to client-side rendering (CSR) for...
View ArticleHow to nest inside ? [duplicate]
I'm using Svelte 5.<a href="my-first-link"><div><!-- Some elements --></div><a href="my-second-link"><div><!-- Some other elements...
View Article