sveltekit Questions
5
Solved
Sveltekit has very strict a11y checks, for instance you can't just add on:click to a div.
I can suppress it on a per-line bases, e.g.:
<!-- svelte-ignore a11y-click-events-have-key-events -->...
Covenantor asked 20/11, 2023 at 19:33
5
To import and use svg file in sveltekit I refer to this article
https://riez.medium.com/svelte-kit-importing-svg-as-svelte-component-781903fef4ae
By the way, when I finally input the code
<svelt...
Precaution asked 30/4, 2021 at 16:33
2
So it looks like I have to separately type the response body going out of an endpoint and the props that I get from that body in the component. For example:
// index.ts (endpoint)
import type { Re...
Tropho asked 16/6, 2022 at 3:42
4
In my SvelteKit project I am using SCSS and in order to include some mixins that are used throughout the project, I switched from vitePreprocess to svelte-preprocess and prepended them with scss.pr...
3
Solved
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 javasc...
Corkage asked 10/8, 2023 at 16:3
6
Solved
I have a page with a search field. If accessed with a query parameter (e.g. ?word=cat) the page should load with results present and the search field filled. If a search is done the results and the...
4
I am new to SvelteKit and have built an initial project from the SvelteKit docs. When the project opens I receive the following error when looking at index.svelte.
Error in svelte.config.js
Error ...
Lockwood asked 23/5, 2022 at 23:43
1
Solved
Svelte 5 Slots are Confusing
Now, with Svelte 5 at pre-release, I feel I can express some confusion about slots in Svelte 5. In Svelte 4, slot and names slots where done in the following way:
Conta...
Iniquity asked 24/6 at 18:22
4
I'm trying to create a new app using SvelteKit & Cloudflare Pages and I'm struggling with running the application locally in a proper manner. Currently, in order to get the app running locally ...
Davies asked 23/12, 2022 at 22:43
4
Solved
I've already gotten my fair share of Bootstrap and Django but never tried out other frontend frameworks like Angular, React, etc. and finally wanted to try SvelteKit. So I'm really inexperienced an...
Unread asked 5/6, 2022 at 21:10
5
Solved
I have been using Svelte for a little while and now I have switched to SvelteKit so I can add multiple pages. I want to add some images to my site but I don't know where to put them. In Svelte I wo...
4
Using @sveltejs/adapter-node: 1.0.0-next.61 and @sveltejs/kit: ^1.0.0-next.225
The following issue occurs only on the build version of the app, and not on the dev server, on which it doesn't occur....
Shivers asked 22/3, 2022 at 9:0
3
Solved
I'm learning SvelteKit and this might be a very elementary question. But I could not figure out how to change the tab's title.
In my src/+layout.svelte I have:
<script>
let title="My S...
1
I'm currently developing a desktop application using Tauri, SvelteKit, & Tailwind. When I run a dev build of my application I frequently get the following error:
[vite] Internal server error: ...
Kilmer asked 31/3, 2023 at 0:20
3
I can't make sense of the docs on this at all.
I'm assuming:
+page.server.js = code that runs server side (fetching data from db etc.)
+page.js = code that runs client side (dynamic stuff in the b...
Melantha asked 13/5, 2023 at 18:38
1
I have a frontend javascript (svelte) and a go backend API. The front end calls the go backend URL to generate an OAuth2 token from github. The backend replies with the crafted url as its response)...
1
Im trying out svelte-kit, and it looks promising. However, I get confused when I run npm run build. I used to get a "dist" folder with a index.html file + som javascript that I could just...
Virtues asked 11/11, 2022 at 16:4
4
Solved
I'm trying to the /login?ref=/some/path parameter to redirect to after login:
const ref = $page.url.searchParams.get('ref') || '/dashboard';
However I get this error:
TypeError: Cannot read proper...
5
I'm interested in capturing the Internet Protocol (IP) address of my users at their initial submit to my website. I was under the impression that a SvelteKit submit would be similar to other node.j...
Siouxie asked 28/12, 2021 at 20:34
3
I have the following setup in my +page.server.js:
export const actions = {
createScore: async ({ request }) => {
const values = await request.formData();
try {
const instagram = values.get(...
Pyrope asked 27/3, 2023 at 14:35
3
Is it possible, in development env, to run SvelteKit app with https?
I tried to run
npm run dev -- --https
and vite starts the server successfully:
VITE v3.0.2 ready in 359 ms
➜ Local: https://...
3
Solved
am new to svelte and svelteKit in general and am trying to load data from api and I followed the sveltekit todo sample code. It's working well for initial rendering and a tag onClick but in div on:...
Elfland asked 20/8, 2022 at 14:49
2
I want to insert in database some data. My database connector is using DrizzleORM in a file named db.ts
src/lib/server/db.ts
import { connect } from "@planetscale/database";
import { driz...
Bearnard asked 18/10, 2023 at 7:50
3
I've created a SvelteKit webapp that works great on my desktop in my local environment. I launch the browser/webserver with:
npm run dev -- --open
Now I've just deployed to Vercel. Everything work...
Obi asked 16/6, 2021 at 0:55
1
I just created a new sveltekit app, installed flowbite component library and flowbite-svelte-icons and started writing some code, but when I checked my app on localhost: 5173 all I saw was this mes...
Coulombe asked 22/12, 2023 at 12:21
1 Next >
© 2022 - 2024 — McMap. All rights reserved.