SolidJS

S

SolidJS

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

Join

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

solid-router without SSR and without having to redirect

I just found out that when i build my app with solid-router its only possible to visit the index page on first page load. I saw the section in the readme.
When deploying applications that use a client side router that does not rely on Server Side Rendering you need to handle redirects to your index page so that loading from other URLs does not cause your CDN or Hosting to return not found for pages that aren't actually there.
I havent anticipated that and i need the users to visit a specific route of my app (as it is possible in vite dev mode) ....

Portals in nested routes not rendering in consistent order

Check out this stackblitz: https://stackblitz.com/edit/solidjs-templates-wwykia Loading /one/two/three first causes the breadcrumbs to render in the order three / one / two, loading /one/two first causes the breadcrumbs to render two / one. Navigating around more seems to sort it out but the render order of the portals is making my current approach for a breadcrumb system super unreliable. My guess is it's some weird interplay of lazy loading routes and portal mounting order, since not using lazy loading seems to make everything work fine. ...
No description

How do I use solid router in the solid playground?

I added solid router to the importmap, but whenever trying to import something it says “Cannot find module ‘@solidjs/router’ or it’s corresponding type declarations”

how to make two-way data transfer through components?

I need to pass a value from a child component to a parent component and back again and idk how to make it

Is createRouteAction removed ? Or Replaced ?

Hi, I just updated my version of solid-start and cannot find createRouteAction in the docs. Can anyone guide me ? Is there a new equivalent ? Thanks in advance 🙏...

Passing "up" signals in Solid

I am trying to understand how can you go by reading values from signals defined in children components in SolidJS. I exemplified my situation in the code bellow (with a solution that I came up with but don’t know if is ideal): I have one component that handles the content being edited (RecordEditor). The submission of the content written by the user is supposed to happens up in the hierarchy, in the AddRecordModal component. That means I need to “access the signals on the children component”. ...

useNavigate - navigate(path) throws "computations created outside a `createRoot`" and error

Sometimes (not 100% of the time) when a user selects a new category in the UI, the following code sends
computations created outside a createRoot or render will never be disposed
and then
Uncaught (in promise) TypeError: Cannot read properties of null (reading '2')
...
No description

(node:53181) Warning: An error event has already been emitted on the socket.

Has anyone ever encountered the problem: ```bash VITE v4.5.2 ready in 435 ms ...

Can't use an image without src/assets/ at the path

I have a problem why can't I use images from the assets folder if there is no src/assets/image.png at the beginning of the path?

solid-router | return Navigate as component

Is there any way to return <Navigate href="/auth/login" /> as a component rather than an element? On version solid-router@0.8 I was able to return an element for a route, however the new version 0.12 requires a component instead. ```jsx...

Anchor with target="_blank" leading to app's URL

I have a link with the href set to an external link for an image. When clicking on this link, a new tab should load the image with given URL. However, instead of loading the image's url, it loads the apps url.. what might be the issue? ```jsx <a class="btn btn-sm" href={store.imageModal.url} target="_blank">View in new tab</a>...
No description

Solid-start site shows blank page when deployed with github-pages

This is the deploy.yml I used https://nitro.unjs.io/deploy/providers/github-pages repo https://github.com/eeek76/eeek76.github.io I tried a minimal solid-start example and the deployed site just shows 404 page....
No description

Is there a way to get Server Reference inside SolidStart? or other way to use webSockets

I just want to know if there is way to get to server reference that would be usable inside Socket.io. Or if there is other way to use WebSockets. Server reference used to be inside FetchEvent : https://github.com/solidjs/solid-start/issues/1017, https://github.com/solidjs/solid-start/pull/1018. Inside event object are now: [ 'request', 'response', 'clientAddress', 'locals', 'nativeEvent' ]. This is example utilizing it in older version of SolidStart: https://github.com/Mirza-Glitch/solid-start-socket.io....

Passing data from `event.locals` to Frontend

Hey folks, I'm super new to solid/solid start, but I'm trying to implement some authentication and I have my user's session in event.locals and its available in Middleware / BE. But how do I access that event.locals data in the frontend? Having trouble finding anything online....

How does the "You might not need an effect" page from react.dev translate to SolidJS's effects?

I feel like they are both the same construct, but since Solid has a fundamentally different way of rendering and constructing components it feels to me like a few things should differ. I was reading through it and thinking about this as I wanted to improve my own SolidJS code. One of the things I am already sure it differs on is for the section of "Resetting all state when a prop changes": https://react.dev/learn/you-might-not-need-an-effect#resetting-all-state-when-a-prop-changes. But as I mentioned, I'm not exactly sure how this section would look like on a SolidJS docs as we don't have one page for this, at least AFAIK. I first wanted to ask a question about this specific section of this react.dev page but I think it might be more interesting to actually discuss the whole page as there may be many things from this page that both might not apply as well might not be the optimal solution inside of SolidJS....

Does solid-element support defining methods on web components?

I'm not currently using solid-element to define my web component, because I need to define methods on it. However, now I find that I want to bind the attributes as reactive component properties, and I don't see how to do that using render(), and it appears that solid-element supports that. I'd welcome either solution, using solid-element with methods, or not using it and achieving attributes as reactive component props....

I'd like to see an example of working with a microservices API architecture

I think this is the example that is missing from Solidstart