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

Image may be NSFW.
Clik here to view.

How would you make an API call and pass data to client with Sveltekit?

I've just begun learning Sveltekit. I'm following the tutorial for Auth.js for making a custom login page (https://authjs.dev/guides/pages/signin), which passes a mapping of the providers to some...

View Article


Scss not prependending variables or global scss on indivdual scss modules in...

Hi I'm new to svelte and having an issue with using scss, im trying to prepend the data so that it prepends to every single example.module.scss file however when I try to run locally, I am always given...

View Article


How to test aria-expanded attributes

I am writing a test for a simple svelte component. It goes like this:it('opens and closes correctly', async () => {render(Menubar, { menuData: menu_with_items });const menuButton =...

View Article

Image may be NSFW.
Clik here to view.

Javascript Audio player stopped after a few seconds

I made an html custom audio player to play an mp3 file. It works just fine locally. It loads all the audio files, but just a little, maybe only the metadata(?). But when I click play, the audio loaded...

View Article

Coverage does not work when using Istanbul

If I run vitest run --coverage when using default's v8 system, everything works, and I get a proper text table with the coverage. But if I use now Istanbul instead, I get an error:>...

View Article


Image may be NSFW.
Clik here to view.

Vite: error 500, SyntaxError: import not found: default

Sometimes, I get a really weird thing: I get an error 500 in sveltekit like:with, in the browser, an error:The next HMR update will cause the page to reloadSyntaxError: import not found: defaultand I...

View Article

How would I go about creating a Django + SvelteKit webapp?

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 and...

View Article

Svelte automatic imports do not work in Visual Studio Code

In preview application I was working on when I typed the name of the component. Like this:I gave an import. Automatically added to script.`<BaseSelect options={optionsDifficulty}...

View Article


Sveltekit + prisma db + multiple databases

I wrote a Web App which uses its own DB. For simplicity, I chose prisma db for the DB stuff. However, everything works fine until I reached the point where I need to connect to a second database with...

View Article


Reactive variable updated from parent and child component

I have a parent component (List) which displays a list of child components (Block). Nested blocks have a button that allows the user to add/remove them to the selection.The List component also contains...

View Article

How to dynamically color an imported SVG icon in Svelte without CSS filters?

I am running into trouble trying to achieve a simple task: with an icon imported into a Svelte component using Vite's asset import, how can I change the color of the icon?<script> // This would...

View Article

When doing e2e testing with Playwright, components aren't fully loaded before...

I'm writing a Playwright test for a test page. The page is extremely simple, it makes a fetch to the backend to make sure it's responding (called liveness) which will return an OK or FAIL.<script...

View Article

Store Component Attributes in a strongly typed array

In svelte, I would like to strongly type an array to match the properties that a specific component exports.So in the following example I would like const things = [] to know that each item within...

View Article


Image may be NSFW.
Clik here to view.

How to put my text in a single line in tailwind css?

I want the result to be like thisbut this is what i getwith my svelte code:<div style="background-image: url('{unsplash?.url}');" class="bg-black flex items-center justify-center min-h-screen...

View Article

sveltekit routes broken, gets +page.svelte from the wrong route

So i have the common svelte kit route structure of just src/routes/pagename/+page.svelteso pretty much my routes do not work, when i visit website.com/paste, it displays the correct +page.svelte for...

View Article


Image may be NSFW.
Clik here to view.

How to publish a forward facing api in sveltekit

I know that perhaps a dedicated server would be better for this, however I'm not familiar with server only frameworks. But I'm very familiar with SvelteKit api routes. I decided to create a route named...

View Article

Move from the sbelt to the controller Can I put the data in the map and go to...

The server is currently using the Sbelt and the Spring is in use.Move from the sbelt to the controllerCan I put the data in the map and go to the page I want?Press the Move button on the sbelt to go to...

View Article


Svelte perform action on a component from another component

I created a svelte modal component based on this example https://svelte.dev/examples/modalHowever, since I did not want the close button coming from the modal, I removed it. The code is a...

View Article

Automatically trigger button to change image svelte

I'm a bit new with svelte, and I'm building a survay for AmazonTurk with it to have video-like player embeded in the webpage.To do that, I am building an image carousel, and need to simulate an...

View Article

Creating logical Array of 'false' in svelte [duplicate]

I need to create an Array that I intend to use as an identifier to render different content one at a time on the screen.I need to create a simple Array = [false, false, false, ...] of some length L...

View Article
Browsing all 1539 articles
Browse latest View live


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