Difference between a = useRef(b); and a = useRef(); a.current = b;
Hi, I've been having a problem with an async callback that I would pass to a component where any state variable called within that callback would always be its initial value instead of the current one. The solution that worked ended up being creating a ref to variables I wanted to use within that callback however if the refs were created like this
...
const picturesRef = useRef(pictures);
const filesRef = useRef(files);
const picturesRef = useRef(pictures);
const filesRef = useRef(files);
Forum channels for Slack?
Random question, is someone aware if there's anything similar to Discord's Forum channels such as #questions available for Slack? 🤔
Did anyone try FlexSearch?
I've found this alternative to Algolia which is open source, self-hostable and free, however I've been having some problems with it.
Let me paint you my use case. I wanted to do a full text search on a lot of data. In this regard FlexSeach is quire performant. But to persist that data I have to save it in a JSON file, then before searching I import it, and only then FlexSearch splits the data into searchable Indexes, in Algolia those are Documents.
The problem is that as far as I've found this full text search engine is not in-memory, which means whenever a request is sent to search (for example if we talk about an API endpoint for searching) it needs to load that JSON first, then index it, then search, and only after that it returns the results....
NextAuth on Apollo Client SSR
Sorry for the bit of a irrelevant question for the discord but is it possible to configure authLink with nextauth on apollo client ssr?
My apollo client is basically this repo https://github.com/kellenmace/apollo-client-cache-rehydration-in-next-js/blob/main/lib/apolloClient.ts
Plus with this auth link
```const authLink = () => {
return setContext(async (_, { headers }) => {...
Error running prisma postinstall
I use pnpm to manage dependencies, but this happened in my terminal when I run ...
pnpm i
assertion failed [block != nullptr]: BasicBlock requested for unrecognized address
(BuilderBase.h:550 block_for_offset)
assertion failed [block != nullptr]: BasicBlock requested for unrecognized address
(BuilderBase.h:550 block_for_offset)
How can I make sure two arrays contain the same keys (in seperate files)
I'd like typescript to spit an error if I update one array, but not the other.
I'm using T3 stack.
So far all I have is:
```...
Solution:
```js
// config/styles.ts
interface Style {
id: string;
label: string;...
Node.js API endpoint for PostgreSQL database backup produces empty SQL file
I have an API endpoint in my Node.js application that should perform a backup of my PostgreSQL database and return the result as an SQL file. The API uses the dockerode library to connect to a PostgreSQL container and run the pg_dump command to create the backup. The API sets the response headers to indicate that the result is a download, and pipes the output from the pg_dump command to the response. However, the resulting SQL file is always empty.
I have logged the output from the pg_dump command and it appears to be running correctly, but the resulting SQL file is always empty. I have tried several different approaches to writing the data to the response, but have had no luck. Can anyone help me figure out why the SQL file...

Custom Nested DB schema defaults or empty help
Field "objectiveIds" in model "Quest" can't be a list. The current connector does not support lists of primitive types.
??????
Objective and Quest are custom models here, one to many. How to many? Do I have to comma parsing?
prisma + planetscale
or should I do:...
More Elegant Way For Type
Anyone know a better way to write this type? I feel like this is repetitive. Thx!

Nodemailer SMTP Emails are not being sent in production.
Just to note I'm deploying my t3 application on my own server, I'm not using Vercel. I have confirmed that my env vars are present and good.
My problem is that mails via smtp transporter on nodemailer are not being sent in production, while locally they work fine with the same setup.
Any help?...
optional authenticated tRPC function
Hi, how can I build a function that can handle a user possibly signed in?
I feel like it’s pretty common pattern, but I fine myself defining 2 functions that are basically the same, one for authenticated users and one for unauthenticated.
Thanks for the help...
Router triggered 2 times
Can somebody tell me why this is being triggered 2 times instead than one?
```ts
api.user.doTraduzioneLatino.useQuery({ email: email ?? '', text: textAreaLatinoRef.current?.value ?? '' }, {
enabled: doTraduzioneLatino === true,...
How to use Next 13/Font inside client component (App Directory)?
I'm struggling to use Jetbrains Mono by Google inside a client component in specific element only, in Next 13 App Directory, how is the right way to do it?
I'm getting this error, seems like the font class is RE-generated when it goes to client
``tsx
Prop className` did not match. Server: "font-bold ml-1 className_f9db54 jetbrains" Client: "font-bold ml-1 className_9b0839 jetbrains"...How can I fetch data in my component
Here is the link to stackoverflow.com displaying how I implemented it
https://stackoverflow.com/q/76112994/19684000...
Proper REST API Nesting
I feel like I am doing too much nesting. Do these routes look semantically correct overall? thanks!
GET
/courses (get course details of courses you are enrolled in)
GET /courses/:course_id (get specific course details, should this get everything related to the course?)...Help Me make a custom login Page
I'm using Credential Provider for nextAuth I want to customise my login page
Unhandled Runtime Error
Top of the code
```ts
const doTraduzioneLatino = (text: string) => {
if (textAreaLatinoRef.current?.value) {
return api.user.doTraduzioneLatino.useQuery({ text, email: email ?? '' })...

CSS Modules (SCSS)
Hi there ✌🏻
I'm new in t3 stack and how to config css modules(SCSS) to it??
thanks in advance...
CVA Boolean type enables
I have a table cell component that I am working on, and im trying to do a couple of styles that can be triggered in a boolean type as they can be mixed with my main variants
i basically want to add the styling of link when link: true is passed in as a prop
```ts...
Solution:
figured it out thanks to https://youtu.be/T-Zv73yZ_QI?t=475
code is
```ts
const cell = cva('whitespace-nowrap px-3 py-4 text-sm font-normal',...