Quantcast
Channel: Active questions tagged svelte - Stack Overflow
↧

How to monitor changes to a Svelte writeable?

Currently I have this code:File A.js:import { writable, derived } from "svelte/store";export const notify = writable(false)File B.svelte:import { notify } from '$lib/store';$effect(() => { if...

View Article


How to display Portable Text block content images in SvelteKit

I'm trying to render a blog post from Sanity Studio in my SvelteKit project.Currently, all of the text etc is being displayed, but images within the block content aren't. Below is what I have tried so...

View Article


How to properly wrap a WebComponent in Svelte(kit) 5

I need to use some WebComponents at $JOB inside SvelteKit, built as a SPA.Supposing that <my-web-component> has:API attributes (like disabled, but custom ones)MethodsEventsWhat could be the best...

View Article

Escape Root Layout Svelte Sveltekit

According to the new routing system you can now group routes and have specific layout files in each group. These files inherit for their parent layout files. You can omit this, by using...

View Article

Svelte KaTeX automatic line breaks

I am generating random math expressions and displaying them on a website using Svelte and KaTeX. Sometimes, the generated formula becomes too long for its container, but instead of automatically...

View Article


wails dev Call from terminal unable to find wails.json

I am using a copy of the Wails + Svelte hello world app and I am using it to do a Svelte tutorial.(Tutorial Link)https://svelte.dev/tutorial/svelte/nested-componentsUp until I reached this particular...

View Article

How to handle expired http requests in Svelte?

The way I have it set up is a class that handles all the api calls. In this class I keep a map for GET requests, key is url, value is AbortController.If a request is being sent and another one of the...

View Article

Accessing SvelteKit vite local development server from Android phone

I have built a landing page with Sveltekit, and I want to test the website on my Android phone while developing the mobile view, is there any way to do this?Before using Svelte (when I used plain HTML,...

View Article


Svelte multiple small components vs regular html elements

Does it affect performance having svelte components instead of regular HTML elements, for small things like buttons, links etc?Wrapping these elements in a svelte component would make it more...

View Article


Access URL query string in svelte

How should I access the the query string parameters from svelte? I'd like my script to behave differently when "?beta" has been appended to the URL.My intuitive approach would be to use the standard...

View Article

How do I use tailwindcss @apply directive inside a svelte component

This works:<div class="list p-2" />This doesn't work:<style lang="postcss"> @tailwind base; @tailwind components; @tailwind utilities; @layer components { .list { @apply p-2; }...

View Article

Astro + Svelte: Imported Svelte Components Have No Type Checking in VSCode

I'm using VSCode, and I've noticed that when I import Svelte components into my Astro components, they are typed as any, and TypeScript does not type-check the props.I have set up my project...

View Article

How to set dynamic html tag according to props in Svelte

I'm creating a Heading component in svelte as a part of learning the basics of this framework. The component behavior is pretty straight-forward. The component will have a prop named level, which will...

View Article


Svelte 5 Unsafe State Mutation at Tree Component

I need help with Svelte components. I've built a tree that should allow users to check nodes and update related nodes. When a node is checked, its parents and children should react accordingly....

View Article

Svelte input blur triggered when element is focused

Maybe its not related to svelte, but if do some DOM changes after input is focused, for example<input onfocus={() => toggleVisibiltyOfOtherElement = true } onblur={() => console.log("blur")}...

View Article


Image may be NSFW.
Clik here to view.

How to Create my own Svelte Embed Component

Certain platforms like GitBook allow you to insert an embed URL, like https://www.youtube.com/embed/eGUEAvNpz48, and it displays as a component on that website, as seen here:I want to create my own...

View Article

Having trouble promisifying Google ReCAPTCHA v2 Invisible in Svelte 5 /...

I have been trying to get Google ReCAPTCHA v2 invisible work with sveltekit 2 / svelte 5 and I have run into a few issuesFirst of all this is the documentation for how to load CAPTCHA in your...

View Article


How to trigger LayoutServerLoad on every navigation in SvelteKit?

I want to add a JWT verification/refresh in +layout.server.ts that is called on every navigation action.I've got following code and noticed that the console.log() statement is only ran, when I reload...

View Article

Svelte (vite?) installing static resources

How can I make static resources (e.g. fonts/images) in a node_modules package available in a Svelte application?I'd like the process to be automatic so you don't have to do anything manual if you use a...

View Article

Parameters in svelte action not reactive

Svelte action that does things when keys are pressed:import type { Action } from "svelte/action"export const keys: Action<HTMLElement, boolean> = (node, active?: boolean) => { function...

View Article

InertiaJS: keep current component

I can't wrap my head around how InertiaJS works...I am using a vanilla PHP backend solution, so all the magic revolving around frameworks like Laravel can't help me.I would like to submit a form (using...

View Article


How to use local static images in Svelte

I was following the tutorial (https://svelte.dev/tutorial/dynamic-attributes) to import local image files. But it didn't work. The image was not found in the app.Where do I need to locate these images...

View Article


Why doesn't Svelte record signals individually?

I'm wondering about internals of Svelte to properly design my application to have maximum efficiency (I may deal with (tens?) of thousands of elements to update, so efficiently does matter), notably...

View Article

SvelteKit container on Azure App Service page rewrite issue /project/1 being...

I have a SvelteKit with Svelte 5 application which I am deploying to the Azure App Service inside of a Docker container.I have routes with a parameter set up like:route/ - project -...

View Article

Image may be NSFW.
Clik here to view.

Svelte 5 memory leak in simple example

I'm encountering many memory leaks when using both Svelte 4 and 5 on reasonably complex projects, and having trouble identifying what I'm doing wrong.Here is an extremely simplified Svelte 5 example...

View Article


binding svelte value to knockoutJS

I am integrating svelte into an old knockout js application, and I thought it would be a good idea to replace the inputs with svelte components.So I created a svelte component: interface Props { value:...

View Article

How to configure VS Code to run npx vite dev when debugging

I am new to VS Code and JavaScript, and I am trying to make a simple app using Vite and Svelte, but I have a problem which I can't seem to resolve. (My code is currently just the default code given...

View Article

Google App Engine - endpoint "GET /_ah/start HTTP/1.1" 500

When changing my applications scaling to manual I kept getting this error in the console Error: Cannot find module '/workspace/index.js' followed by multiple errors of "GET /_ah/start HTTP/1.1" 500Tech...

View Article

How do I upgrade to more recent versions of Svelte?

Two questions.If I have Svelte 5, how do I upgrade to more recent versions of Svelte 5?eg 5.0.0. to 5.1 etcHow do I even know what releases there have been?

View Article



Why does Chrome black out, or crash with "aw, snap - out of memory" when...

I'm developing a Svelte-based Javascript single-page app with a lot of Apache ECharts displays in it that is fairly heavy in both DOM elements and array data, but generally stays in the 400-500MB range...

View Article


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