Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Browsing all 1539 articles
Browse latest View live
↧

Is it possible to embed tailwind classes in a Svelte custom component...

I am building a custom component (web component) in Svelte and Tailwind.My goal is to make this component have self-contained styling, but I have trouble with including the Tailwind stylesheet inside...

View Article


Can't seem to Import .glb / .gltf in svelte with vite

I cant seem to get .glb or .gltf files imported.<script> import HallucinateForm from "../components/HallucinateForm.svelte"; import ModelViewer from "../components/ModelViewer.svelte"; import...

View Article


Handling potential null external svelte 5 state

I have an external state with an exported getter in file.svelte.ts:let data: T | null = $state(null);export function get_data() { return data;}A component should use this state, however the component's...

View Article

How to trigger/force update a Svelte component

I am trying to get my head around the svelte 3 reactivity thing...I wanted to force refreshing a UI on a button click. I am using a custom component AsyncFetcher that accepts HTTP post data, and...

View Article

Svelte 3 - How to loop each block X amount of times

I'm hoping to find a way to iterate over an #each block a set amount of times in Svelte 3. In Vue I would do something like this:<li v-for="i in 3"><!-- somecontent --></li>But as I...

View Article


Svelte 5 - Uncaught ReferenceError: $state is not defined

I am trying to make Svelte 5 project (I know it is still in alpha, but I want to play a bit with it), and I am using this as a template for nowMy App.svelte<script> import { withPrevSignals }...

View Article

[GSI_LOGGER]: The value of 'callback' is not a function. Configuration ignored

I'm migrating from Google Sign-in platform to the newer Google Identity Services library.App.svelte:<svelte:head><script src="https://accounts.google.com/gsi/client" async...

View Article

Rendering multiple composers in three.js

In this clip im trying to render two differnt composers to the canvas in the animation cycle but only the last composer in the loop gets rendered to the screen, or the transparency of one layer doesnt...

View Article


Serving .js and .css from Vite + Svelte to a static website

I have a pre-existing website using a popular website builder.I want to be able to inject interactive svelte components on certain blog pages to help demonstrate concepts.I got a rough prototype...

View Article


How do I import Bootstrap in SvelteKit, Recommended Way?

I am building a site with SvelteKit. As of now I included Bootstrap 5 in my project by adding it to the app.html file provided by the SvelteKit Skeleton project:<!-- Bootstrap styles and javascript...

View Article

"Uncaught (in promise) TypeError: ...img is undefined" when using...

I'm encountering an issue using @sveltejs/enhanced-img in my Svelte project. I've installed it via npm install --save-dev @sveltejs/enhanced-img and configured it in vite.config.js.My setup involves an...

View Article

How to shutdown gracefully in sveltekit?

I am using adapter-node and a mysql pool in a sveltekit web app.Previously, using just nodejs and express and no sveltekit, I found I needed to shutdown the mysql pool connections cleanly or mysql...

View Article

sveltekit checkbox, checked unchecked then checked again

i have a problem with checkbox. Checking animation isnt smooth as expect. When i click on checkbox its checked then unchecked and checked again. I dont know how can i fix that. i am using sveltekit...

View Article


Data seems not reactive, possible bug in svelte.dev tutorial? [closed]

I am talking about Svelte.dev tutorial.Basically, everything (after using the solution of course) works fine (handler answers, database answers, new position is added to array of data.todos), just the...

View Article

Image may be NSFW.
Clik here to view.

array.find() with sveltekit reactivity functioning sporadically

An app showing a list of building systems components with the ability to add a component. Database is Mongodb.+page.js fetches the list, a defintition of the table + populates "lookup" lists (to...

View Article


Image may be NSFW.
Clik here to view.

sveltekit client array available sporadically in reactive function

An app showing a list of building systems components with the ability to add a component. Database is Mongodb.+page.js fetches the list, a definition of the table + populates "lookup" lists (to display...

View Article

Can't receive push notif in capacitorjs using FCM

I creating app using CapacitorJS and Svelte with php Backend, my problem is I fail to implement push notification while app is backgrounded (or killed)here my Android manifest<?xml version="1.0"...

View Article


How to assign default prop values with Svelte 5 and TypeScript?

Suppose I have the following Svelte 5 component:<script lang="ts"> const props: { name: string; age?: number; } = $props();</script><div>Name: {props.name}</div><div>Age:...

View Article

Error in svelte.config.js Syntax Error: Cannot use import statement outside a...

I setting up svelte.config.js like code below:import preprocess from 'svelte-preprocess';const config = { preprocess: preprocess(),};export default config;Suddenly, my Svelte codes keep getting error...

View Article

SvelteKit: dev/build and path problems with static assets referenced in CSS

In the CSS section of a Svelte file, suppose I use a background-image:div { background-image: url(img/bg.jpg); }The image file is in the static folder (static/img/bg.jpg). This simple example runs...

View Article
Browsing all 1539 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>