Authenticated routes in SPA
I wanted to expose this question to more people and thought of this discord server.
Original post in GH:
https://github.com/solidjs/solid-router/discussions/364
...
How to do client side redirects
Quick client vs SSR question: What is the recommended way to do a redirect from the client side? My understanding is
throw redirect()
is only available from an SSR context.
Also, if I wanted to redirect regardless of whether I was client of server side, would "use_server"
along with throw redirect()
be appropriate there. If not what would the recommended way to do this be....Dynamic `<head>`
Hi everyone
Is possible to put on
app.tsx
a dynamic <head>
tags (Title
, Meta
, ...)?
Basically I have all my content manage on a CMS, and I want to se the base title, the base meta tags fetching from CMS, but if I try to use createResource
on app.tsx
gives me an error....useContext from function dynamically imported
I'm building a keyboard shortcut management system and wanted to be able to dynamically import the action associated with a keybinding. Some of these keybindings may use a context so I've intentionally put the keyboard shortcut manager provider inside of all other providers.
action: () => import("../actions/switchColorScheme")
and in my index file:...How to send emails
Hi everyone.
How I can send emails from a contact form? What should I use?
Thanks...
Testing createResource with dynamic import
I'm trying to test an
Icon
component that I built that uses a dynamic import inside of a createResource
. I attempted to mock createResource
but couldn't get it to work as expected... I'll just post a simplified version of the component in the hopes that someone knows based off of the code. And FWIW I'm using vite-plugin-solid-svg
to import svg files as solid components.
Also, I was prompted to try to do this because I can run tests to get 100% coverage on statements, branches, and lines... but my function coverage was like 3%. It seems to be related to the dynamic import so perhaps I'm barking up the wrong tree with createResource
?
...memo is rerun but any side effects subscribed are'nt reran
```ts
const [jsonData, { mutate: setJsonData }] = createResource(initJsonData);
const [saved, setSaved] = createWritableMemo(
on(jsonData, () => {
console.log("update saved");...

useRouter hook
I'm trying to use the useRouter hook so that I can acquire the base path and pass it into my sidebar component without the end user having to write it themselves. Also, I'd like to acquire all defined routes so that I can match against whatever route was defined in my component, and tell the end user the route defined doesn't exist. But correct me if I'm wrong, is the useRouter hook private?
...
Missing "./dist/routing" specifier in "@solidjs/router" package
Missing "./dist/routing" specifier in "@solidjs/router" package
Deploying solidstart problems
TBF I probably have 2 separate problems.
I'm trying to deploy a start project on vercel, all I get after a successful build is a 404 NOT_FOUND error, when visiting my page. This is my first issue and I'm getting no clues as to what could be wrong.
When building locally, in order to test it out, I can't try out my build because the data in my .env file, which works in dev mode, doesn't seem to be included in the build, so the whole app crashes as the server tries to use an env variable that doesn't exist. I can't identify why this would happens as my file is simply name
.env
so it should be included every time.
...<For> throws Cannot access 'product2' before initialization
I am wrapping my component in a show on product().name and have used debugger to step through and verify the Component is not run until product().name is set, yet I am getting this error originating from the <For> below:
```
<For each={product().imgs} fallback="loading">
{(item, index) => {...
createMemo question
Is there any drawback to using createMemo for 'cheap' calls? Does the overhead, whatever it may be, make it not worth it for 'cheap' calls?
```jsx
const inputError = createMemo(() => formCtx.errors[props.name]);...
Embla Carousel
Hi everyone
I'm trying to use embla carousel, but I'm facing a issue with the size of the elements, for example the image isn't full the space.
Anyone using embla that can help me?...

<For> throws hydradtion error with a <span> as fallback element
This fails
```
<>
<div id="products-container">
<For each={props.products()} fallback={<span>loading</span>}>...
Corvu Dialog
Hi everyone
How I can receive the
Dialog.Trigger
from the @corvu/dialog
by props?
```tsx...modularforms controlled/transform inputs not working
Hello, I am encountering multiple issues using modular forms with solid js
many functionalities like controlled inputs and transforms seems like not work reliable, let me share with you some recordings
here is a demo https://stackblitz.com/edit/modular-forms-solid-n51ey1?file=src%2Fapp.tsx
This is regarding to transform on inputs...
Showing error on ssr static builds, but don't know what it is
It does not show on "dev" env, also while building static ssr build it breaks all the JS and actions like buttons doesn't work anymore.

createAsync different values on client and server SSR issue
I'm trying to conditionally render components based on auth - think paywalled content.
I have a server function that detects if user has logged in:
```
const _userLoggedIn = cache(async () => {...
Pass props from Component to props.children
```jsx
function Child (props) { return <div class={props.class}>child</div> }
function Parent (props) {
// I want parent to be able to customize the props passed to children here...
Appropiate type for Router root
Help me get rid of this error.
I put an any on it but linter complains at me. What would be appropriate type for props here?
```...

How to create and test a data fetching library?
Hello everyone, I am working on a SolidJS integration for GQty. PR#1758 is the current WIP, I am probably doing a lot of things wrong.
There are two areas about Suspense where I would really love some help to learn from the perspective of a library author.
1. Triggering Suspense...