svelte Questions

2

I try to wrap an application into a 'Repository' component and that outer component should handle all communication with the backend, like loading, updating, deleting editable data. I thought I cou...
Brownell asked 22/5, 2020 at 21:45

3

Solved

I'm trying to create a system in my SvelteKit app where it shows you info about the current app version (ideally a Git commit hash and description) on a certain page. I tried using Vite's define fe...
Vamoose asked 19/11, 2021 at 11:52

1

I created a svelte app using Vite from the Svelte template. I have a tiny package.json and I want to start using Sveltekit. Here is the package.json { "name": "jxb2", "pr...
Gumma asked 13/2, 2023 at 2:50

2

Solved

I'm new to SvelteKit and trying to find out how to load the Google client library for Javascript. Google tells me to do it like this: <head> <script src="https://apis.google.com/js/a...
Tradeswoman asked 3/1, 2022 at 18:56

7

I am trying to build an SPA with role based access using Svelte. Coming from Angular with its route guards, I want to setup something similar. What would be the best way to do that? EDIT: I was ind...
Oberammergau asked 3/7, 2021 at 16:59

2

Solved

I have a form that updates a product's information using a form with use:enhance and actions defined in +page.server.ts - However, whenever I submit the form, use:enhance resets the form elements a...
Theophylline asked 28/12, 2022 at 9:36

1

Solved

+page.svelte <form action="?/upload" method="post" enctype="multipart/form-data" > <input type="file" name="file" id="file&quo...
Charlinecharlock asked 1/2, 2023 at 19:30

5

I have some serious problems with reactivity in Svelte. I have isolated what I think is at least one of my main issues. When bind:ing a variable to a checkbox, the reactivity seems to break when se...
Contemplative asked 17/9, 2019 at 9:8

1

I am using Vite svelete-ts template. I changed the project structure to bundle every page in one single file without chunks. Everything works except typescript imports for .svelte extensions. I don...
Athanor asked 2/11, 2021 at 9:36

4

Solved

I installed bootstrap using NPM In a normal svelte project I usualy add bootstrap and other packages, which are used project wide, in the App.ts file. However, in a SvelteKit project there is no ma...
Aleuromancy asked 21/4, 2022 at 10:28

2

Solved

I'm curious, what's the best way to forward or dispatch events across multiple levels in component tree in Svelte JS? Say I have App.Svelte, some intermediate number levels, each containing a child...
Bissau asked 27/1, 2023 at 14:54

5

Solved

I am running svelte like this on my server: $ npm run dev Your application is ready~! πŸš€ - Local: http://localhost:5000 ────────────────── LOGS ────────────────── Which is great. However, wh...
Sears asked 4/8, 2020 at 21:40

1

Solved

I am trying to implement JWT-based user sessions with SvelteKit, and have mostly been following the explanation for form actions given on their website: https://kit.svelte.dev/docs/form-actions +pa...
Selfanalysis asked 25/12, 2022 at 20:23

2

i'm using clickOutside action bellow. export function clickOutside(node: HTMLElement) { function detect({ target }: MouseEvent) { if (!node.contains(target as Node)) { node.dispatchEvent(new Cus...
Ventriloquize asked 18/7, 2022 at 15:46

2

Solved

I have created some components which take an optional prop like hide={true}. My problem is that these annoying error messages always flood my console when I don't pass that prop: <MyComponent&g...
Vander asked 16/6, 2020 at 9:15

5

<script> let count=0; </script> {#each list as item, i} <div class="item"> <Item /> </div> {/each} How do I increment the count on some condition insid...
Dibru asked 15/7, 2021 at 11:48

3

Solved

I'm trying to create custom-element (web component) in svelte 3. I can't find any way to style nested components from css. Svelte removes styles before injecting them to <style> inside of Sha...

2

Solved

I need to run a Svelte app and be able to execute it without a server. With other frameworks this is possible as it is just javascript but I can't find a way to just click my index.html and run my...
Eyla asked 23/5, 2020 at 1:9

2

I'm using svelte to create a personal website. I want to place a chunk of javascript code in the head of my final HTML code, which is based on a svelte component. So I have something like <svetl...
Verbenaceous asked 14/8, 2020 at 19:55

2

Solved

vite.config.ts import { sveltekit } from '@sveltejs/kit/vite'; const config = { plugins: [sveltekit()], test: { include: ['**/*.spec.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], environment: 'jsdom', g...
Avalokitesvara asked 23/9, 2022 at 17:55

4

I am a newbie on Svelte and in coding in general. I'd prefer to learn SvelteKit (Svelte@Next) rather than sapper since that seems to be where Svelte is heading. For my personal project, I need to s...
Tarsia asked 28/1, 2021 at 2:44

2

I have a load function in SvelteKit. It fetches some data. Is there a way I can display a loader before load function resolves? Or have some SSG that will be updated once SSR is resolved? Anything ...
Allynallys asked 18/2, 2022 at 0:9

1

Solved

I am trying offical SvelteKit example https://realworld.svelte.dev/. Its code is hosted at https://github.com/sveltejs/realworld login and everything works fine when I run npm run dev but when I ru...
Undercoat asked 8/1, 2023 at 1:46

3

Solved

I want to build a svelte app using svelte-kit for staging environments. I did not find a suitable command to take .env.staging as its configs. When I execute svelte-kit build it always takes .env.p...
Zoie asked 25/9, 2021 at 9:38

4

Solved

I can't find any example anywhere online that shows how to (or if we can) output a single HTML file from a Svelte project using Rollup (not Webpack), containing all CSS and JS injected inline (and ...
Salesmanship asked 2/5, 2020 at 19:38

© 2022 - 2024 β€” McMap. All rights reserved.