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

How to import KafkaJS into a Svelte page?

I have tried importing my Kafka library inside page.svelte, and it has thrown an error saying it is not allowed to import Kafka inside the script.<script> import Table from "$lib/Table.svelte";...

View Article


How to show the selected slug value as selected in dropdown in Svelte

I navigate to this page with the slug param deckId, I have a dropdown menu that is bound to deckId.My problem is that when navigating to the page or refreshing the selected option disappears. The...

View Article


Why is my github page only showing a blank screen with Svelte + Vite?

Here are the steps I took condensed:Published my project using VSCode's publish repo button.added the npm command: npm run deploy => npx gh-pages -d distran npm run buildran npm run deployadded...

View Article

Why does Sveltekit raise "Error loading dynamically imported module" on...

ContextI added and installed this svelte datepicker component in my small Svelt-Kit project.The page where it should live is a CSR-only page (meaning +page.js contains export const ssr=false).// src...

View Article

How reload CSS in svelte component without reloading page?

I use live reload on my Rails app. In sprocket CSS (normal mode), change CSS in code make a refrech css in browser without reloading page.I add Svelte in my rails app and now, if I change CSS in...

View Article


How to Properly Implement Custom _headers for Cache Control in SvelteKit with...

Is there a better way to handle CSS caching with SvelteKit and Cloudflare? Despite changing CSS file names on build the outdated CSS is still cached and loaded becoming an issue with obfuscation. My...

View Article

Image may be NSFW.
Clik here to view.

When using pocketbase with svelte, pocketbase returns a 'fetch failed' error...

So I have a simple svelte app in which I want to perform CRUD operations using pocketbase. I have setup a collection "user" in pocketbase which has a table of fields name and age. I tried to perform a...

View Article

Weird {#each} iteration order w/ Svelte

I'm building a simple container that displays a collection of GIFs, and I've encountered an unexpected behavior when trying to dynamically render GIFs based on the selected category. Here's a snippet...

View Article


Add class to svelte component

I created two components:1. btn.svelte<button class="btn" />2. btnHold.svelte<script> import Btn from './btn.svelte';</script>I'm trying to add a new class btn--hold to...

View Article


Why doesn't my fetch POST function work in Svelte?

I have a Svelte application that is supposed to perform CRUD operations with a local JSON file via the Fetch API.The "GET" operations works as intended but when I tried to create the "POST" function, I...

View Article

Issue sending messages to a channel group in Django

I sat up a system with a user, member and team models. What i am trying to achieve with sockets, is for one of the team members to notify everyone on the team about an achievement.Clientside:Svelte...

View Article

Initial load animations for Sveltekit SSR pages?

I've followed the issues in github, and it seems to be a HUGE open-ended question in terms of 1st party support. Has anybody implemented any type of logic to enable transitions on initial page load?...

View Article

How to enable csr on a SvelteKit component?

I'm aware that I can enable/disable csr on SvelteKit routes, but can I do it on a single component?My current code looks like this:layout.ts:export const prerender = true;export const ssr =...

View Article


After svelte init - App.svelte won't show up

Dumb question incoming: Where is App.svelte? I initialized a project skeleton with npm create svelte@latest myapp, cd into it, do npm install and npm run dev, but App.svelte won't appear. There is an...

View Article

Image may be NSFW.
Clik here to view.

What headers do I need to set to get in my Fetch Request?

I'm trying to get a Fetch request in a Svelte component working. It works fine if I use curl and Postman. It looks like my headers may be wrong. Any ideas on what I'm doing wrong here?This is the curl...

View Article


How to retrieve response data from a fetch post request? [duplicate]

I'm trying to display the data comes back from a server, I can see the data coming back from the server I'm hitting when I look at network tab in Chrome's developer window.How can I get access to it in...

View Article

Starting out Svelte / Sveltekit - from usual JS / HTML / CSS - what's the...

Picking up Svelte, and while their documentations/tutorials are touted as amazing, I'm still unable to figure out how to serve an entirely static website. So pre-rendered, SSR, and all those funky new...

View Article


Why won't my SvelteKit code run on page load?

I've built many pages that run fine but whenever I put this code in a file it never runs. It doesn't delete the cookie, and I don't get redirected.I've tried putting the code just in +page.ts, I've...

View Article

Sveltekit deployment on vercel failed because of Error [LibsqlError]:...

Using sveltekit with turso and drizzle-orm, the only similar issue I got is: https://github.com/tursodatabase/libsql/issues/1121the website is working fine on local if I use url:...

View Article

How to have parent wait for the onMount event from its child component?

How do I make the parent component wait for the child component to render?In the example below, I have a button the shows "IconSun" some milliseconds before switching to "IconMoon". If I surround that...

View Article
Browsing all 1539 articles
Browse latest View live


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