SolidJS

S

SolidJS

Solid is a declarative reactive Javascript library for creating user interfaces.

Join

Import error with Outlet

This is the code I apply to my routes to protect them from users who are not logged in, and I get this error in the browser console, I don't understand why I get this error if I followed the documentation. ```import { Outlet, useNavigate } from "@solidjs/router"; export default function ProtectedRoute({ canActivate,...

Create signal from store element

I have a component that takes signal as a prop: ```ts const NumberInput:Component<{value:Signal<number>}> = props => { // Stuff... return <input>{some fancy business}</input>...

How to react to length of store array?

I have a store representing an array:
const [pools, setPools] = createStore<Pool[]>([])
const [pools, setPools] = createStore<Pool[]>([])
Elsewhere I render a list based on that array:...

SolidJS with Router behind Apache Proxy

I had initially written my app without a Router and it was working fine running behind an apache proxy, but I wanted some of the cool features of the Router so I added it, but none of the routing works behind the apache proxy. Everything works fine locally without proxy, but no longer behind the proxy. There's probably something I am either forgetting to configure in vite or in solid or in the apache proxy, but have no clue what it might be. Basically I defined some routes as so: ...

Error in NSwag generated api client

Anyone experienced the problem " Unexpected reserved word 'let'." when building your solid-start app. I'm using Nswag for generating clients for my api:s, and when im using the generating classes i get the problem. This is the with-auth repo cloned with a NSwag generated file. When removing line 22 in lib/server.ts it builds fine. https://github.com/djeka07/my-app

Handling errors in createResource

My createResource handle fetches data from a REST API and is displayed on the screen. I have interval that calls refetch to refresh the data. If the fetch fails, my interval will keep running, and even if the remote service comes up, the refetch occurs, but the page never renders the new data. Is there a better way to handle errors in my resource? I don't want to try catch and return no data, as I want to display the existing data until new data can be retrieved....

How to update data saved on local storage

I save data on local storage, but I might change the structure of the data or how I use it, which might break the users that is keeping the old data structure in their local storage. What is the best way to handle this update of local data.

SolidJS Universal - How does the method of tree creation get chosen?

I'm currently using SolidJS universal in order to dynamically create multiple trees of nodes as the primary tree is being built so that there is no need for traversal for every insertNode(). These other trees skip nodes that are in the primary tree, but still need to connect to nodes that are higher/lower in the tree, if that makes sense. The trouble that I ran into was that in some cases (i.e. shallow trees), the tree is being created in a breadth-first approach. In other cases (i.e. wide/deep trees), the tree is being created in a depth-first approach. This makes it much more complex to know if nodes are being added bottom-up or top-down, and was wondering if there's a way to configure this, or know if there's a way of figuring out which method will be chosen. Thanks!...

Solid-Start preloads 404 page instead of OAuth API route

I'm trying to set up OAuth in a Solid-Start project. I have a API route for a GET request to redirect to the 3rd-party server which works when accessed directly. However, when I try to make a link to that route, the app preloads the 404 page, instead. How can I get it to navigate to the correct route?

Solid-Router: "named views" equivalent?

What would be the solid-router equivalent of vue-routers "named views"? https://router.vuejs.org/guide/essentials/named-views ```js { path: '/',...

How to add headers to static asset responses with Solid Start?

I want to add a couple headers to all the static asset responses, and can't figure out how to do it. I've tried adding middleware (doesn't apply to static assets), and have tried adding routeRules in the Nitro server config, but these seem to not work either. ```javascript export default defineConfig({ start: {...

stop screen flicker from createResource refetch?

I'm refetching from a database every three seconds to display the most up to date values from a database without having to refresh the page. ```js const [fetchedOnline, { refetch }] = createResource( () => [selectedZone(), selectedJob()],...

Need help opening

I dont understand the error. pls help
No description

css styling out of route options

This <div class='main-wrap'> <div class='main'> <Routes>...

multiple layout

Routes folter ``` (auth).tsx (auth) --signin...

Can anyone tell me how best to do it? Store API

``` import axios from "axios"; import {ErrorApi} from "~/utils/tryCallApi"; import {IBaseResponse, UserProfileEntity} from "~/types"; import {getCookieValue} from "~/utils";...

Export Vercel Functions config on @solidjs/start@0.5.9

Hello ! I've managed to update my 0.3.0 project to 0.5.9 by scooping info here and there on the Github commits & issues. However I'm having an issue with API routes when they are deployed on Vercel Functions. I've got API routes that trigger a long call that builds a PDF on the node server. - test-export: bare bones export that creates a 256px image and exports it as a PDF using jsPDF - high-res-export: complex export that assembles large pages and exports them as a PDF using jsPDF...

How do I upgrade a solid-start project to use the latest version of solid-start

I found a project that uses solid-start and actually has a working PWA. But it is from february 2023 and I want to update it to the newest version of solid-start and its current structure. Is this possible and how? The current version is ^0.2.20 (The repo in question: https://github.com/seeplusplus/solid-start-vite-pwa)...

React is not defined when using custom server directory for Vite

Hi! If I use custom directory on the same level as src for dev mode in Vite & Solid setup, I get React is not defined error. Steps to reproduce: 1. Create new Solid project with npm create vite@latest 2. Move index.html, index.tsx to separate dev directory...