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

Get the position of an inline-block element

I'm trying to get the final position on screen of a div element part of a Svelte 4 component, which is instanced several times over the page.I've been trying several ways, including that one, but I...

View Article


Why is Svelte's bind:innerHTML retaining an outdated string?

Content is displaying correctly, bind:innerHTML isn't tracking changesThe content of a div containing two {#each} blocks is bound to a variable via bind:innerHTML. These {#each} blocks are responsive...

View Article


TypeError [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

svelte resolve if statement during animation

I have some svelte code that simplified looks like this{#if conditional}<ContentA/>{:else}<ContentB/><Drawer transition:fly><Compontent /></Drawer>{/if}in most situations...

View Article

Is there a way to run JavaScript from a string in browser with imported...

I have a function that lets me run a JavaScript function in the browser:export async function executeFunction(data: LoadOutput, input: Record<string, any>): Promise<any> { let args = [];...

View Article


Is it possible to access Svelte store from external js files?

I am wondering if i would be able to access my Svelte store values from a plain .js file.I am trying to write functions returning a dynamic value based on a store value, to import them in any...

View Article

How to block routing if the user has not logged in

I'm currently working on a svelte project using express, with a login page. I wanted to make that if the user has not logged in, he will be redirected to the /login until he logs in. If the user has...

View Article

With Tauri how can i save a file to a specific path?

I have this code:async function downloadMod(url, folder, basePath) { const httpclient = await getClient(); const file = await httpclient.get(url, { responseType: ResponseType.Binary });...

View Article


Load a glb in threlte?

I'm trying to follow the first example in this threlte doc and load my glb model (satellite.glb) on the canvas. I can't get it to load. Can anyone tell me what I'm doing wrong in my replit here? I...

View Article


SvelteKit Form Action not returning success / remains null

I have the following setup in my +page.server.js:export const actions = { createScore: async ({ request }) => { const values = await request.formData(); try { const instagram =...

View Article

Image Source Not Updating on Audio Element State Change

I'm implementing a basic audio player using Svelte (version 4.2.8), with SVG images for the interface icons, but the play/pause icons are not updating as expected.Stripped-down version of the...

View Article

Image may be NSFW.
Clik here to view.

Remove the max value splitLine on Y axis

I've been trying to hide the max value splitLine on Y axis. It is marked in the image below:In case it isn't possible, what I am trying to achieve is to have the max value of Y axis be 30% larger than...

View Article

prettier is not picking up .svelte files without specifying them explicitly

I've created a svelte project and wanted to use prettier. I have prettier svelte plugin.pnpm exec prettier --write .will only pick up js and html files.pnpm exec prettier --write...

View Article


What is an elegent way to use tab in a text area with two way data binding in...

I'm experimenting with a text editor (just playing around with different ways to make one) and am using a svelte text area. One problem with this text area is that tab is not enabled by default. I was...

View Article

svelte 5 - how to write JSDoc for props

I have following snippet file, in which I would like to add JSDoc in order to defines tables and table in {each} part of the code.<script> import { dialog } from "../store/dialog.svelte"; /** *...

View Article


Migrate to SvelteKit's New Routing System

Don't know about you, but I've been hearing about this new routing system in SvelteKit. I first heard about this with the +error.svelte file that I found here on the official docs. Not soon enough,...

View Article

Don't get any public folder when deployment in svelte kit app

I develop a svelte kit app and go to deploy using "npm run build". "npm run build" command works correctly and successful. But it didn't make any public folder for deployment. can you guys have any...

View Article


Why are svelte derived stores always recreated on get()?

Now this is more directed towards Svelte authors I suppose, but I just recently fully realized that derived stores are constantly recreated on get.Example<script>import { derived, get, writable }...

View Article

Why is this Sevlte useSelector implementation not calling the derived function?

I've been trying to get Redux working in Svelte to make porting some React based code that use useDispatch and useSelector hooks simpler.I found a useful guide which leads to a Gist. I've gone through...

View Article

Image may be NSFW.
Clik here to view.

Github Pages with sveltekit only shows the HTML contents of app.html

I have a SvelteKit website deployed with Github Pages. All it shows is this:The path is https://username.github.io/src/index.html. (I renamed app.html to index.html because routing to...

View Article
Browsing all 1539 articles
Browse latest View live


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