How to Handle Fetch Calls with Writable Stores in SvelteKit SSR without Eager...
In the below snippets fetchPage($currentPage, $selectedOption); gets called on each page refresh as if that would be onMount(). I believe this is why I'm seeing following warning related to my...
View ArticleCan I get the IP address of my users in a SvelteKit project?
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.js...
View ArticleHow can I pass components from server files to svelte pages with Svelte5?
I am writing a blog site using mdsvex and SvelteKit5. My current +page.server.ts file tried to pass the rendered component, but it is now a function and not an object (link to docs) and therefore I get...
View ArticlePass docker environment-vars to vite(svelte) docker-compose stack
I am trying to get docker-compose to properly pass my env vars to my svelte(kit) app running on vite.https://github.com/dafeist-github/SongRex/commits/main/On the link above, you can see any possible...
View ArticleCSS font size reset?
In my code, I use css which sets the HTML font-size property to different percentages according to the screen width so any rem values are changed accordingly but now my font sizes are all messed up...
View ArticleSvelteKit: redirect() not working on server without disabling ssr
I am using +layout.server.ts to redirect unauthenticated users from accessing authorized routes with this code:/* +layout.server.ts */export const load: PageServerLoad = async () => { // ... if...
View ArticleDrag and drop event propagation
I'm attempting to setup drag and drop in my projectI've got several fields setup like thisIf a user clicks the image on the left and drags, they can re-order the rowsWhen a valid dropzone is detected...
View ArticleHow to avoid "Typed Svelte Components" on svelte, using Typescript
In a simple, very simple svelte (Not Svelte Kit) app, using Typescript, VSCode is giving me this error in "Router" and "Route" classes of svelte-routing:CODE:<script lang="ts">import { Router,...
View ArticleCan a SvelteKit App be turned into a web component?
I'm quite new to Svelte/SvelteKit but have been using Vue for years. I decided to port one of my Vue projects over to Svelte that is a custom web component that is used on several sites running on...
View ArticleWhat is the best way to implement event handling on multiple list of child...
Let's say I have a to-do list. Each list item has a delete button which will delete the item from list array if clicked. Now we can use these methods.1.//store.tsexport type Item = { text: string; id:...
View ArticleWhat does `svelte-kit sync` do?
I've checked the svelte-kit sync docs and the discussion around it and even tried searching Stack Overflow and asking AI.My understanding is it generates tsconfig.json and is for setting up the project...
View ArticleSvelte DND create new DNDZones
I'm trying to build a DND survey editor using SVELTE. I use svelte-dnd-action. It should be possible to add new categories and questions to a 'root' DNDZone via copy and drag from a bar with the...
View ArticleHow to compile Svelte 3 components into IIFE's that can be used in vanilla js
I am making a web component in Vanilla JS that use a hidden select in the background and a div and ul>li in front. It became a bit complex with fetching data from an api, ect, so I transitioned to...
View ArticleHow to compile a Svelte app to a Web Component/Vanilla JS that can be used on...
About a year ago, I created a Vue web component that could be included on any website to facilitate Open Banking payments in the UK. We've even got a WordPress, Magento & Shopify plugins that uses...
View ArticleHow do get query string parameter in sveltekit?
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 properties of...
View ArticleSvelteKit - How to download a file from the assets?
I'm using SvelteKit and I have a file src/assets/my-file.pdf. I'm trying to make a button to download it:<a download="my-file.pdf" target="_blank" href="assets/my-file.pdf"> Download</a>But...
View ArticleHow to solve Error: EPERM: operation not permitted in Visual Studio Code with...
Lately I'm getting the "EPERM: operation not permitted" error in Visual Studio Code while working on my SvelteKit project. It also happens on new projects. The error occurs randomly (when using npm...
View ArticleTailwind CSS missing from universal Svelte web component
I've managed to create a Svelte web component that can be used on external websites running on different frameworks.The final problem I'm having is that Tailwind doesn't seem to be included in the...
View ArticleManipulate innerText in a slot while keeping slot style with svelte
I want to make a component that makes a typewriter effect, but I need to keep the styling inside the slot so I can use any text style with the same effect.Main file :<TypewriterText><h1>Hey...
View ArticleHow to handle concurrent refresh requests ins sveltekit?
In my sveltekit app, I created a 'customFetch' function that will be used in +page.server.js load functions in order to retrieve some data from a third party backend. The catch: The backend uses...
View Article