file input element doesnt work if its inside a form
i have an interesting question. i have a pretty big dynamic form that im managing rhf. one of these form elements wants to allow the user to submit a picture. Inside this I have a button to submit a new picture:
```ts
<input
form="test"...
Not able to console.log in NextJS 13
Alright so kind of a dumb question, but there's no such thing so here it goes. Building out a simple recipe store website, currently trying to display a single recipe, using the id slug to query my DB for it.
I guess the first thing I'm not understanding is why none of these console.logs are printing anywhere? They are neither in my browser console, nor in the terminal window where I'm running npm run dev.
The second problem is that the H2 that's supposed to render the recipe name isn't being rendered on the page, though I suspect I'll at least have a bit of an easier time figuring out what's going on with that if I can at least see these console.logs ๐
...

Switching over from Material UI to Headless UI + Tailwind. Any recommended tutorial for tailwind v3?
I have not really done any CSS in general (started with MUI). I see a tutorial for "Tailwind CSS v2.0: From Zero to Production" on Tailwind Labs (https://www.youtube.com/watch?v=elgqxmdVms8&list=PL5f_mz_zU5eXWYDXHUDOLBE0scnuJofO0&ab_channel=TailwindLabs) but did not know how much of a difference there is between v2 and v3. Any recs for a v3 tutorial?
Websockets & Connection Upgrade on Next server
So i've been trying to bind a websocket connection from client to server on next, and i've done my usual server flow for this kind of shit:
```ts
import { NextApiRequest, NextApiResponse } from "next";
import { WebSocketServer } from 'ws';...
Is this waste of space?
Hello lets say I have router
```
export const coinRouter = router({
getCoin: publicProcedure
.input(z.object({ name: z.any()}))...
recommended solutions for storing images
Hey,
I was wondering if anyone had any recommendations for storing images for my app.
Each image will be less than 150kb. Currently unsure about how many I am going to need to store ...
What's wrong with my Next Auth and Layout code
import type { ReactElement, ReactNode } from 'react'
import type { NextPage } from 'next'
import { type AppType, type AppProps } from "next/app";
import { type Session } from "next-auth";
import { SessionProvider } from "next-auth/react";...
File sending on form submit
So I'm trying to make a mutation, and that should generate a txt file and send back to the user. So far I have this
```ts
import { z } from "zod";
import fs from "fs";
...
when to make new component react
After reviewing my stuff I realized that I don't make a lot of components. So my question is when should I make a new component? Also how should i structure my files? Currently src/components but should i make subfolder if projects gets bigger?
encode uuid to be accepted by google
I'm querying google's calendar api and i get back some 400's due to invalid id. i read on their docs what they match and have concluded they don't support cuid (cuid uses letters up to z and google accept a-v), so i changed to uuid but i keep getting back 400 and so i tried removing the separating dashes to make it happy.
is there a proper way to do this encoding/decoding? right now i did a pretty nasty hack with regex (to remove when posting google's api) and split (to add them back when querying the api). the id's in my db uses prisma's generated uuid so they have dashes, hence i need the dashes in order to be able to match them.
tldr; what's the proper way to encode/decode uuid?...

Really weird TypeScript behavior
Hey. I have this really weird type inference error. So the types do get inferred correctly, as you can see in the first screenshot below. However, when I actually want to call the function the types disappear and become type
never ๐
The type inference correctly picks up the fact that the function parameters can either be "1" and no arguments, or "2" and no arguments....noob question - expo react native - react navigation modal issue
I need help with react-navigationโs modal component. At the moment the modal opens in front of the screen from which it is called from which is what i want.
But when i close it, it does not refresh the screen from where it was called from via use navigation.goBack().
This makes sense as the screen is not destroyed. It sits behind the modal, But that screens data is being updated via the model so i need it to reflect that update immediately upon the modal closing. Iโm using react query. ...
Benchmarking slow LCP and TTI
I'm looking for advice on this, because I really don't have a mentor to turn to and I'm feeling pretty lost overall. I've detailed before that I'm refactoring a SPA made with CRA that is meant to replace an AngularJS app that was mounted inside a JSP and served as our previous "version" of this page. I've improved performance quite a bit compared to where it was, but I'm still seeing a rather large gap, and I'm trying to audit A) How much can I reasonably improve performance, and B) Where should I look for benefits at this point?
For a bit more context - because the old application is in a JSP, it gets served HTML from our server which contains a pre-computed JSON string that is parsed and added to the page's service. The new version lives in an S3 bucket and sends multiple requests out for data upon page load. I originally thought this was the primary source of difference remaining between the two applications, because naturally sending to a remote server for data will be slower than parsing JSON that is passed alongside HTML. However, I experimented with removing those calls and simply parsing out a hard-coded JSON string with data, and I'm still reading a significant difference in mobile score (around 56 for the new vs 80-85 for the old page).
When I profile the page (CPU 4x throttled, network fast 3G) I'm noticing a significant difference in the number of long tasks that appear to be falling under the umbrella of React-DOM vs the number that happen on the old AngularJS environment. I've attached screenshots of the trace, in case anything seems fishy. I genuinely don't really know how to interpret these results - does React-DOM often struggle when network/processing speeds are throttled, more so than this other app would?...

tRPC useQuery ReturnType
Working on a custom auth provider (just wanted to do all the stuff myself, learn the flow, ya know) and trying to get the result of a trpc
useQuery passed through context. I can't seem to figure out how to type the context, as the data always comes out as unknown.
```ts
import { procedure, router } from "../t";
...Are these Prisma models okay?
Hey I'm trying out prisma and I'm attempting to make a bug tracker. Just wondering if these models seem fine or if there's anything I can do to make them "better".
Most bug trackers have a bunch of different roles but I'm new to this so I'm keeping it simple with just a user and an admin (me). Then a project manager which is just the user who created the project so they wouldn't have a role the actual project would have a manager and a user would have a list of projects they manage I think?
For the user model I haven't hooked up NextAuth or anything yet so I'll probably have more fields when I get that far. Just trying to get the initial setup goin. I've seen examples with Account and User with a bunch of information that comes from NextAuth....

Augment user type in JWT callback
I am trying to get access to
user.role here, but no matter how I alter the next-auth.d.ts, it doesn't seem to change this user object.```ts
callbacks: {
jwt: async ({ token, user }) => {
if (user) {
token.id = user.id;...Better way to this kind of UI in react (State Based)?
```jsx
{playState === PLAY_STATE.NOT_STARTED && "Debug Mode"}
{playState === PLAY_STATE.PLAYING && (
<div className="flex items-center gap-x-1">...
TypeScript Mapped Types
Hey. I have this type which uses mapped types to generate this other type. It works a little bit, but I'd like it to generate a different type of type union.
