alan
Explore posts from serversTTCTheo's Typesafe Cult
•Created by alan on 7/27/2024 in #questions
recommended pattern for sharing data from same api across multiple client components using approuter
after reading https://nextjs.org/docs/app/building-your-application/data-fetching/patterns and https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#sharing-data-between-components, I feel like I'm seeing two contradictory recommendations.
I initially would fetch data from a server component that would pass down the data two its two child client components and found that the json data, even though parsed in the server component shows up in the client components as strings, which means that I'd have to parse it yet again in the client components.
then I see that it might be discouraged to follow this pattern according to the second link and instead use nextjs's fetch, which may lead to something like this
in both client components that would use that same data since it would be cached. which pattern is actually recommended here?
3 replies
DTDrizzle Team
•Created by alan on 7/8/2024 in #help
getting used in key specification without a key length error when referencing text type column
how would I resolve this when using with mysql2? Thank you
1 replies
TTCTheo's Typesafe Cult
•Created by alan on 7/3/2024 in #questions
Is anyone else having issues with cloning skateshop
https://github.com/sadmann7/skateshop has been mentioned a couple times here. I was able to barely clone it after it had been stuck at 9% and now I'm getting a module cannot be found typescript error for all non nextjs-related modules.
2 replies
TTCTheo's Typesafe Cult
•Created by alan on 3/31/2024 in #questions
how to use yarnrc.yml
I found this
in a yarnrc.yml and the current locally installed version of yarn-berry seems to be broken. I'm unfamiliar with this tooling and was wondering how I'd go about updating the version of yarn and the plugins. Is this something I can do with the CLI?
3 replies
TTCTheo's Typesafe Cult
•Created by alan on 3/28/2024 in #questions
can anyone recommend a library to use mutating operations but return new unmutated objects?
the best I can think of is immutable.js but I was wondering if anything better is available. I'd rather use push and splice instead of using object spread operators for deeply nested objects. thanks!
4 replies
TTCTheo's Typesafe Cult
•Created by alan on 3/23/2024 in #questions
how to get better-sqlite3 to work in docker
hello. I'm getting this error when trying to run a t3 app with better-sqlite3, which I'm using with lucia auth to run and I tried using a newer node alpine image (18 and 21). The error is very similar to the one reported here https://github.com/TryGhost/node-sqlite3/issues/1581
any help would be appreciated.
12 replies
TTCTheo's Typesafe Cult
•Created by alan on 3/18/2024 in #questions
Nextjs in standalone mode with Auth.js(v5) returns JWTSessionError
hello. I'm getting this error:
and was wondering how I can resolve this.
I found this related thread https://github.com/nextauthjs/next-auth/discussions/6030 which suggests to
but I don't use nginx and am just running the nextjs app in standalone mode. thanks
2 replies
TTCTheo's Typesafe Cult
•Created by alan on 3/17/2024 in #questions
How to fix next auth beta redirecting to undefined path
hello. I'm trying to work with next auth beta and it's redirecting me to localhost:3000/undefined after signing in and I was wondering how to fix this such that I get redirected either to /signin or /. Thank you.
22 replies
MModular
•Created by alan on 2/3/2024 in #questions
how to use the python unittest library in mojo
tsia
2 replies
TTCTheo's Typesafe Cult
•Created by alan on 10/29/2023 in #questions
.env.local values undefined in vercel serverless endpoints
I have a few vercel serverless golang functions that I would like to use and I have a
.env.local
. but it's not recognized in the functions, although it's recognized in my nextjs project. how do I fix this when running vercel dev?2 replies
TTCTheo's Typesafe Cult
•Created by alan on 10/22/2023 in #questions
accessing route handler issues 404 error
I have this route handler at
src/app/api/foo/route.ts
:
but going to http://localhost:3000/api/foo issues this error:
when running vercel dev
, which I need to run for accessing some api endpoints using golang serverless functions, but it works just fine when I run npm run dev
. how to fix this?2 replies
TTCTheo's Typesafe Cult
•Created by alan on 10/21/2023 in #questions
how to resolve hydration failed error when including button shadcn dialog
I have this dialog built out of shadcn's components:
which is giving me this error:
but goes away when I remove the Button component. wai?! thanks!
17 replies
TTCTheo's Typesafe Cult
•Created by alan on 10/18/2023 in #questions
how to include text snippets in responses from google drive api full text search
TSIA
2 replies
TTCTheo's Typesafe Cult
•Created by alan on 10/15/2023 in #questions
how to get conditional tailwind classes to work
I have this
and see in devtools resolving to
w-[300px]
for example, but width is not defined. however, if I remove the conditional logic and just set
it works as expected. how do I re-enable the conditional logic without breaking it?8 replies
TTCTheo's Typesafe Cult
•Created by alan on 7/30/2023 in #questions
typewriter effect react library
can anyone recommend a react library like this https://github.com/tameemsafi/typewriterjs that has an auto typewriting effect, except that it would change the value of an input element instead of the text content of an element? the vanilla js version seems to support what I'm describing but not the react component
2 replies
TTCTheo's Typesafe Cult
•Created by alan on 7/21/2023 in #questions
react-icons or one of the underlying libraries?
do people care about stylistic consistency and stick to one icon library or just pick and choose from react-icons?
3 replies
TTCTheo's Typesafe Cult
•Created by alan on 7/1/2023 in #questions
is infinite scroll with comments only possible with graphql?
that is, in nextjs with the app router, using nodes and edges.
2 replies
TTCTheo's Typesafe Cult
•Created by alan on 6/29/2023 in #questions
using zact with react-hook-form issues error
hello. when I try to call a server action wrapped in zact like so, I am getting this error:
- error ReferenceError: Cannot access 'callMyServerAction' before initialization
. This only seems to happen once I introduce react-hook-form and validate on the front end as well:
removing zact altogether fixes this and maybe including backend validation is overkill?2 replies
TTCTheo's Typesafe Cult
•Created by alan on 6/27/2023 in #questions
toasts vs banner notifications for forms
or anything in general. I found this thread https://ux.stackexchange.com/questions/91406/what-is-the-difference-between-alert-notification-banner-and-toast-message but am still a bit confused as to when it's more appropriate to use one vs the other. I'm personally partial to error messages close to the fields that caused them over toasts which would just be an error soup crammed into a single box. This makes me think that toasts don't really have a meaningful role. I suppose toasts are good for success messages for a particular operation?
3 replies
TTCTheo's Typesafe Cult
•Created by alan on 6/27/2023 in #questions
t3 app in turborepo now throws 404 error when accessing root
7 replies