svelte Questions

1

I am constantly getting errors like the ones below in VS Code console under the Svelte Intellisense Language Service dropdown. If I restart VS Code they go away for a while but begin to show up aga...
Izy asked 15/9, 2019 at 14:59

4

Solved

I have a svelte kit project. I want to deploy the app in an Nginx web server after an npm run build. At the moment I have a node container and I use to start using npm run preview. It's working fin...
Feckless asked 17/12, 2021 at 21:10

3

Solved

Background I am attempting to develop a cross-platform desktop app using Svelte and Tauri When the app starts i need to load a settings.json-file from the filesystem into a custom Svelte store. It ...
Crapulent asked 8/4, 2022 at 23:40

1

Solved

I am new to svelte so I cannot figure this out how to solve this after many tries. Imagine I have a component Navbar.svelte in the $lib/component. As usual I will add this component to my +layout.s...
Misbeliever asked 23/9, 2023 at 1:47

3

Solved

When using tailwind responsive classes (ex: md:my-auto, focus:ring-0, focus:outline-none) in svelte kit component style tags, I get the following error: 500 Semicolon or block is expected ParseEr...
Evie asked 30/5, 2021 at 6:38

3

Solved

I would like to make a component in SvelteKit which has a randomized parameter. The problem is that the value this parameter takes is different for when the page is rendered server-side versus when...
Postrider asked 14/1, 2022 at 17:34

3

Solved

I have a modal component and I want to be able to destroy it when the user clicks on the x button, I also have a notification popup that destroys itself after an interval but I'd like to give the u...
Tearjerker asked 1/6, 2020 at 6:12

5

Solved

let c = 0; $: console.log(c); If we want to print the value of c when it is changed, we can write like above. Because c is used in $ directive literally, so this statement can be reactive to c. ...
Wiltshire asked 11/7, 2019 at 7:37

7

Solved

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...
Immorality asked 4/7, 2019 at 15:44

1

I'm working on an app that renders a tree structure graphically. There are various node types in the tree, each with a corresponding Svelte component which renders it. One of the features of the ap...
Adin asked 29/8, 2021 at 5:14

2

Solved

I want to get the user agent on the load function to choose whether to perform server-side rendering or not depending on the visitor is googlebot or not. How can I access it inside the load functio...
Goblin asked 4/4, 2021 at 19:54

3

Solved

I have been looking arround on how to set a production port for vite but I can't find way I have tried this vite js config server: { host: true, }, preview:{ port:5005 } but it seems like it...
Onieonion asked 22/12, 2021 at 8:58

3

Solved

I am writing a Server Side Rendered app with Svelte/Sapper and I am having trouble using Font Awesome fonts. I am using the following to load the font: <script> import Icon from "svelte-aw...
Arrowood asked 30/5, 2020 at 3:36

3

Solved

I have a simple form having email, password and confirmPassword. I use action to handle this. I want to implement a spinner that will be triggered for the following actions Checking if user is cur...
Fruiter asked 29/6, 2023 at 11:51

1

Solved

I am new to svelte. I have a route defined like this: /posts/[slug]. How do I access the slug in page.svelte file? <script> let slug = ... </script> I have tried searching online but c...
Pyroxenite asked 3/8, 2023 at 2:7

3

<button on:click={() => (visible = !visible)}>Toggle</button> {#if !visible} <QuizArea transition:slide on:score={e => { playerScore = e.detail.score; }} /> {/if} ...
Intestinal asked 27/11, 2019 at 2:8

2

Solved

This is my code block looks line when used with a useCallback hook in react but I want to use same function in svelte,but want to add this in useCallback hook. Is there any alternative for svelte. ...
Lelahleland asked 29/8, 2022 at 7:22

3

Solved

Let's say I have a /foo route. But sometimes people hit /foo with a language parameter: /fr/foo. And other times they might hit it with a language and a country: /ca/fr/foo So I need a routing ta...
Jadwigajae asked 1/6, 2019 at 0:46

3

Solved

I have a store.js file whose content is : import { writable } from 'svelte/store'; export const generateds = writable(0); console.log("generateds", $generateds) Each time I try to acces...
Dropsonde asked 22/2, 2021 at 17:39

2

I wanted one of my route in my app not to be server side rendered. The way to do this will be doing export const ssr = false in module script or setting ssr: false in svelte.config.js as mention in...
Cosenza asked 2/10, 2021 at 5:31

0

I had a project made in Sapper and attempting to recreate it in sveltekit. Unfortunately I'm unable to use my expressjs server code I have because I'm unable to get vite to start the app using my o...
Platitudinous asked 20/7, 2023 at 19:19

4

Solved

I'm trying in the <script> to manually document.createElement and then to appendChild an audio every time an eventListener is called to replace it. Everything works fine in the browser, apart...
Thorfinn asked 17/5, 2019 at 6:0

4

Solved

I have a SvelteKit project and for some reason, ./$types doesn't have the module PageLoad (which other projects do. I'm not sure what I did/didn't do to not have it. This is the error I'm getting: ...
Footlight asked 17/11, 2022 at 3:0

1

I am using Svelte for the first time in a setup with SvelteKit + Vite. I am trying to import a rich-text editor from a node module into a component of my app. Here is the snippet: <script> i...
Sabec asked 5/5, 2023 at 9:54

1

I have a Sveltekit Web Application that you can find here You can also find the full code here My problem is the following: When I change the page, the new page gets appended to the end of the curr...
Olav asked 10/7, 2023 at 10:34

© 2022 - 2024 — McMap. All rights reserved.