I need to redirect users to login page if they are not authenticated. I need something like route.beforeEach in Vue.js, ideally: sapper.beforeRouteChange((to, from, next) => { const isAuth = "[some session or token check]"; if (!isA...
I've decided try out Svelte for my next website, and this will be a static website hosted using GitLab pages. I got the basic compilation working which generates dist/bundle.js and dist/bundle.css. The issue is that I cannot upload this dist fo...
Learning how to use Sapper. I have a component with form (the form has one field to enter an email address) and use fetch to post the data to the serverhandle. When I post the data and try to log the data I posted, it logs Undefined. I have no idea w...
Currently, I'm working on a project which shares a Menu component across all pages except two pages. I added the menu component inside root _layout.svelte file. Now since two pages that don't need Menu component are nested routes. The Menu is...
I'm receiving raw html snippets from a headless CMS that I need to render as-is in a Sapper application. This also includes cases where I receive an opening tag and the corresponding closing tag as two pieces of HTML between which I add a Svelt...
I created register page, and submit without any input. I got 200 ok though backend server raise 400 reseponsed how can i get right status on my js code? below image is api call to my backend server and responsed 400 status api.js const base...
My sapper app revolves around a table component. This table component has state (offset, limit, sort, filters, etc) that I would like to represent in the query string of the URL. The table works fine currently by directly updating its state: <bu...
I have been trying to load the ace editor (https://ace.c9.io/) into my Sapper application. I had success loading it in the script tag when I loaded it in a Sapper route, but when I am trying to do the same in a Svelte component which is again rendere...
I am using Sapper with Svelte to create a static website. Because my website is static, I won't be bothering with a server and will use the sapper export command to generate static files which I can host on GitLab pages. I have therefore remove...
Essentially I'm working on a slideshow project where each "slide" is loaded dynamically using <svelte:component this={currentSelection.component} />. Each slide requires custom in and out transitions on a component-by-component ba...
©2020 All rights reserved.