svelte Questions

2

Solved

My goal is to make a darkmode for my web app. To get my setup enter npm init vite and pick svelte as a framwork. Then follow the command line instructions. Go to src > App.svelte: Try the follow...
Twin asked 6/4, 2022 at 1:46

2

I am trying to make an app using svelte to try it out. I would like to setup prettier and eslint, I installed those dependencies and the extension for Svelte for VS Code. "dependencies":...
Prevost asked 15/8, 2020 at 12:13

1

Solved

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 vite...
Arlettearley asked 29/6, 2023 at 2:7

5

Solved

I don't understand this section in the tutorial: https://svelte.dev/tutorial/keyed-each-blocks. I can see the things array is updated correctly so the right thing.color is passed as expected. But b...
Jutta asked 21/6, 2020 at 13:37

2

Solved

I use Svelte i18n for my project, it works perfectly in my Svelte components. But I have some JS files (for constants for example), I want to use i18n to translate some keys, like (in /services/con...
Bio asked 8/9, 2021 at 17:44

4

Solved

I want to create a svelte component that receives the name and path of an image. I want to have the component set the image as the "background-image" using CSS. I've tried the following which does...
Floorboard asked 24/7, 2019 at 2:21

3

Solved

I have created a svelte app and building app using SvelteKit everything is works fine. I tried to deploy this app in firebase hosting but it fails. Sveltekit generating production build under .svel...
Pickar asked 8/8, 2022 at 18:23

6

Solved

I'm working on a sveltekit app with a sidenav containing links. I can't get the active class styling on my links to work properly. The links are components in NavLink.svelte: <script> import...
Bystander asked 6/1, 2022 at 20:19

4

Solved

I'm trying to dig into Svelte 3 (v3.7.1) and it works quite well ... with a few stumbling blocks when it comes to including external CSS (bootstrap). But nevertheless, one thing I cannot seem to w...
Pembroke asked 7/8, 2019 at 9:2

0

I am familiar with Vite's very easy .env setup where you can have .env, .env.production, etc. With Sveltekit's "new" private/public/dyanmic stuff, I am not sure how it works now. Currentl...
Merideth asked 12/6, 2023 at 20:43

2

Solved

I’ve created a monorepo with Turborepo that contains 2 SvelteKit apps and 2 packages: a component library (which is also based on SvelteKit) and a configuration package. root | |- packages | |- com...
Misdeem asked 5/5, 2022 at 14:46

3

Solved

I don't know how to type Svelte 3 reactive syntax variables. <script lang="ts"> import type { Player, Team } from "./types"; import { DEFAULT_PLAYER } from "./util...
Petropavlovsk asked 2/6, 2021 at 10:13

9

Solved

I was trying to create an Input component for my project. I want to set type attribute dyamically on input element But when i set type attribute dynamically on input i get error saying 'type' attr...
Pederasty asked 7/8, 2019 at 10:53

4

I am hosting a svelte app in GitHub pages, so its served from a subfolder. The problem is that all links aren't working anymore. Basically I need to change the base URL of the app, but I don't know...
Blaisdell asked 17/3, 2021 at 22:9

3

Solved

I'm working on a component and i need to use context for it. But i don't know why when i using getContext, It's undefined. This is a part of my codes on first component (Index Component): import { ...
Monarch asked 3/8, 2020 at 9:22

1

I cannot figure out how to catch and handle unhandled exceptions globally on the client side in SvelteKit. I have created a very quick demo app below to show what I am seeing: https://github.com/Ja...
Maybellmaybelle asked 30/4, 2023 at 13:49

2

What I'm trying to achieve I'm trying to create a svelte component (using TypeScript), create a type, export it and import it into another file. Options.svelte => svelte component that also exp...
Heddie asked 27/11, 2020 at 20:15

8

I want to use css framework in my svelte project, in this case it was uikit. I had install it with yarn add uikit And of course i have to import the css file, with @import '../node_modules/uikit...
Tamer asked 6/6, 2019 at 18:29

3

Solved

Is it possible to define a special mapping that enables PhpStorm (or other WebStorm based IDEs) to have the ability to find files located in SvelteKit's special $lib directory alias? For example, i...
Antecede asked 21/3, 2022 at 3:39

1

Solved

I am currently using svelte's context api to pass user data through out my application. Suddenly I came across this error that has practically no documentation anywhere that I could find. The error...
Stuffy asked 25/4, 2023 at 2:35

4

I am currently learning Svelte and SvelteKit and so far I like it. However one thing that puzzles me a bit is the question when I should use form actions and when should I use a simple on:submit ha...
Shelled asked 1/3, 2023 at 23:29

3

Solved

I work in a group that has several projects, and each one is written in a different framework. We would like to have some self-contained widgets whose behavior and appearance are standard, but can ...
Pugh asked 9/4, 2020 at 23:0

2

Solved

I have the following enhanced SvelteKit form: <script> import { enhance } from '$app/forms'; </script> <form method="POST" use:enhance> <input name="name&quot...
Rego asked 7/1, 2023 at 16:12

8

I have about 80 custom SVG icons that I'm importing into a Svelte front-end app. Building on https://github.com/sveltejs/template, it's built with Rollup and includes Typescript, Tailwind, and all ...
Until asked 5/2, 2021 at 19:44

2

Solved

I would like to display a version that is declared in the package.json file in the footer of my site How can I do this? I found this FAQ explanation in their documentation, but unfortunately I don'...
Spiritless asked 6/5, 2022 at 12:12

© 2022 - 2024 — McMap. All rights reserved.