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

Image may be NSFW.
Clik here to view.

Svelte 5 how to fetch data from an API?

I am not sure how to fetch data in SvelteKit 5. In the below data is a Proxy object<script>export async function load({ fetch }) { const res = await...

View Article


Can't access props in data in +page.svelte

I am working on a SvelteKit application where I need to display the details of an article from an external API. I'm using a load function to fetch the article data, but I'm encountering an issue with...

View Article


Trigger $: when value is not used directly

I have this code in my svelte component:$: { console.log(dateRange) formatDataForChart() .then(data => chartData = data);}I want to run FormatDataForChart() when dateRange is updated, but i dont...

View Article

visible, non-interactive elements with an on:click event must be accompanied...

A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.svelte (a11y-click-events-have-key-events)what does this error mean ?...

View Article

In Svelte with Vitest is there a way to mock the browser value in...

Seems like there should be a way to modify the value of browser. Typescript doesn't allow assignment eg browser = true; yielding error: Cannot assign to 'browser' because it is an...

View Article


Adding vercel.json breaks Vercel deployments

Adding a vercel.json file with the following cron job breaks Vercel deployments on master in my SvelteKit project.{"crons": [ {"path": "/api/cron","schedule": "* * * * *" } ]}With no logs or anything...

View Article

Can a Svelte component dipsatch its own instance?

For nested Svlete components, where an Outer contains several Inners, is it possible to create a dispatcher with createEventDispatcher in Inner that would communicate the instance that called the...

View Article

Can't use flowbite Button into vitest+jsdom?

I'm trying to build basic component testing via vitest and jsdom, so I created vitest.config.js containing:import { defineConfig } from 'vite';import { svelte } from...

View Article


Google Drive API in svelte - How to make user don't have to re-signIn after...

Hey I'm just wondering how can i use google drive api to let user don't have to re-sign in the account to make request with google drie api in my svelte projectFor now after i signIn everything works...

View Article


Image may be NSFW.
Clik here to view.

How to reset and get of of a layout in sveltekit?

How can I reset layout inheritance in Svelte?ParentI have a parent layout at src/routes/+layout.svelte:<script> import Header from...

View Article

SvelteKIt: getting an error "Handler should return a response", though I am...

I have a simple API endpoint server function that imitates an authorization POST request:/** @type {import('./$types').RequestHandler} */import { json, error } from '@sveltejs/kit'export async function...

View Article

Load basic Google Map with array of coordinates in SvelteKit

I am new to web development, so also SvelteKit. I am trying to show a Google Map with markers for a list of locations. The locations come from coordinates. I have found a few similar posts here and on...

View Article

Deploy SvelteKit with AWS Amplify

Hi I've been trying to deploy my Svelte kit 1.0 to AWS Amplify. I push the commits and then Amplify builds and verify the app pass , but then if I visit the app URL it's just a blank page. Please see...

View Article


Deploy static Svelte-Kit app with AWS Amplify

I'm trying to deploy my Svelte app on AWS Amplify, I push the commits, Amplify builds and verifies the app, but then if I visit the app URL it's just a blank page, it might be an adapter problem? I...

View Article

svelte.config.js: Unexpected option config.kit.vite

I just started learning Svelte/kit, I stated a small project to learn, I wanted a calendar. I found svelte-calendar package in npm. I installed the package,npm i svelte-calendarAnd I set this in...

View Article


Hosting svelte-kit on aws amplify

I’ve been trying to deploy my svelte-kit project to aws amplify but whenever I do, despite the build and deploy stages being successful, the page returns a 404 error. I’ve changed the build settings to...

View Article

Svelte - getting ERR_MODULE_NOT_FOUND from svelte.config.js

I am learning Svelte currently and I am not sure what is causing this error. The error exists within every one of my .svelte files, though it is not actually preventing the app from running.I am using...

View Article


Add tooltip option to ssr chart with echarts

I generate a chart thanks to echarts in server-side :getChart.tsconst chart = echarts.init(null, null, { renderer: 'svg', ssr: true, width: 400, height: 300 }); chart.setOption({ xAxis: { data:...

View Article

Image may be NSFW.
Clik here to view.

How to reset layout in sveltekit?

How can I reset layout inheritance in Svelte?ParentI have a parent layout at src/routes/+layout.svelte:<script> import Header from...

View Article

SvelteKit / Problem with CSS-Stylesheets and Event-Calendar Module

I've got stuck on a problem with SvelteKit, CSS and the event-calendar module.I just open a new skeleton SvelteKit-project to test some of the calendar-modules.Everything good at this point. But...

View Article
Browsing all 1539 articles
Browse latest View live


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