dion
Explore posts from servershydration mismatch when wrapping component in a suspense
I am trying to render a loading ui when data is being collected on the server:
For context this is routeData that i defined on the parent route:
Observation:
1. When i put a delay of 5 seconds, and reload the page, a GET request is sent to the server the page will show that it's loading for 5 seconds
2. Once the 5 seconds is up, a POST request is sent to that page's routeData, then it loads for another 5 seconds.
3. This is the time when the error below appears. The suspense will now also show the loading fallback.
4. Once the 5 seconds is up, then the page now shows the correct data.
TLDR, i have two questions:
- why is there a total delay of 10 seconds to load the data in when i only put a delay of 5 seconds
- why is there a hydration mismatch error
3 replies
whats the use case of routeData and useRouteData
From my understanding, it seems possible to directly get the data needed using ‘createServerData$’ to fetch the data on the server, or is that an anti-pattern?
From the docs, it seems that routeData is called once per route, but in most apps that i’ve built, i usually do the data fetching at the component that needs it. I.E, i’ll have pass it down as props.
2 replies
Request data not consistent between createServerData$ and API route
I have a lucia x trpc x solidstart project setup.
TLDR: I'm observing that the
event
passed to my createServerData$
and the event
that is passed to my API handler is different.
Here's my project structure:
Here's how my API handler for trpc has been setup src/routes/trpc/[trpc].ts
The cookie here is logged as {}
On the other hand, in another route, src/routes/(auth)/signin.ts
The console logs out the authentication details.
I'm confused as to why this is the behaviour since I thought both routeData and API routes are accessing the same request
2 replies
Unable to find modules
Hey guys, new to solidjs and SSR frameworks in general. I'm testing out a solidstart template generated using a community tool called "Create JD app". This allows me to quickly spin up a boilerplate project similar to create-t3-app.
The problem is that I'm facing this runtime error:
Doing a build results in the following error:
Here's my vite config file:
I would love to know what is happening, since there's no errors that are being thrown by my editor, not sure of where to start...
3 replies