JWT Session Error in Next Auth
I am setting up simple discord auth using next auth but I am getting a JWT Session Error, I have not touched anything from ct3a scaffold
Help defining Prisma schema
Hi guys I need some help defining my prisma schema.
I have this template schema in which I would like to add tags:
```ts
model Template {...
TS possibly undefined object
Im getting a warning that numberOfQuestionsPerCategory[category]; might be undefined
Why is this - i checked above if it was undefined?...

server component throws error
``tsx
export default async function BotCommandsSection() {
const commands: BotCommandsResponse = await fetch(
${BASE_URL}/api/commands`
).then((res) => res.json());...trpc first callH
Hi there! I'm trying to create my first trpc route, trying to copy the example route
1. Define a router in
src/server/trpc/router/route_name;
2. Import and register the router in src/tprc/router/_app
3. import the router into the component from src/utils/trpc";...
Astro as a multi-app host (i.e. microfrontends)
This might be a silly question...but would Astro be a ridiculous thing to use to host multiple apps? I.e. think Google Docs.
Could just use Astro for the header navigation and each "app" could just be hosted on its own page. Astro would take care of the auth, and provide a unified SPA like look and feel while hosting multiple apps. The apps would just be a single component on each astro page.
I'm trying to think if there are any downsides here. Would simplify deployment, and it would allow apps to be written with different frameworks, all while keeping a common look and feel....
Battling TypeScript Types
I have been struggling with this typescript issue for a bit now and not sure how to fix.
I have an object containing some data that I import. It looks like this.
boom has a crazy long type considering each of the objects in the array. (where I think this is making things hard).
```ts...
trpc useQuery fetch on demand
```const [query, setQuery] = useState<string>('')
const [suggestions, setSuggestions] = useState<Shop[] | null>()
const { error, data, refetch } = trpc.shops.getByName.useQuery(query)
...
Import order
is there a vscode extension or prettier/eslint setting to do this?
```ts
// packages first
import a from 'a'
import c from 'c'...
Initial React Context value.
Let's say my ContextProvider looks like -
```
type Action = {type: "modal_open"} | {type: "modal_close"}
type Dispatch = (action: Action) => void
type State = {isModalOpen: boolean}...
NextAuth session storage
I'm a bit confused reading the NextAuth documentation (probably because my knowledge of security is not very good).
Well, it says that NexAuth by default stores sessions in JWT (which is probably safer than cookies), but when we add an adapter to the database (I added it), it starts storing them in a server side cookie.
I'm wondering whether to do a custom config now to store the session back in JWT. Are server side cookies enough?...

Where do you go for UI inspiration/problem-solving?
Do you look at UI component libraries for collections of interfaces? Do you keep a lookbook/swipe file/figma with ideas?
Using clientside only library with nextjs (t3)
I have been working on a rebuild of an ancients system that we use in nextjs (t3 all in with ts) however we require to use a javascript library for connecting to our printers (dymo labelwriter sdk), what is the best way to achieve using the library with the t3stack without getting hydration issues or a load of type errors and not having the library run on the server side?
(the library is old and kinda shitty and I don't feel like trying to rewrite it)...
Zod in commercial projects (work)
Do you use Zod in your projects at work?
A new one is starting for me, but we are holding back with the decision (we are considering Yup), because we are afraid that there may be a lot of work with inputs in forms that are dependent on each other (for example, if the user selects a checkbox, this field becomes mandatory, otherwise not, or if the value of one is more than 200 then the other must be less than 500). PS: We dont use tRPC
Do you have any experience?...
React rendering on different viewport
I'm currently making a custom Navbar with drop-downs, with should behave differently depending on a viewport, is it better to have same navbar written twice with html and hidden with css or rather change functionality of one depending on a viewport with React?
Question: Working with prisma JSON types
I've had this "thing" with prisma + TS after switching to it for a while so I was wondering how are you people properly parsing types of JSON fields prisma,
suppose I have some model
```
model SomeModel {...
api calls don't work in vercel
I'm trying to call my NextJS API:
If I try to write
const res = await fetch("/api/commands"); I get the error 'failed to parse URL' despite the API endpoint clearly existing and being accessible via http://localhost:3000/api/commands.
To get around this, I declared a base URL variable so I could at least make it work in localhost and hopefully Vercel too (according to Vercel's docs they have a VERCEL_URL that points to the deployment's URL):
```js...Raw HTTP Requests to TRPC
Hey,
I have an api route that I need to create in my nextjs app that will be called from a non-javascript client.
How would u make a http POST request to a TRPC route?...
Any Benefits to using Auth0 in Next-Auth?
Hey, currently working on an expo app that uses Auth0 for auth. Planning on using it aswell for the nextjs app. I was looking at next-auth, and it seems to provide functionality to use Auth0 as a provider.
Would there realistically be any benefits to using this? I feel like it would just be easier to use the
@auth0/nextjs-auth0 package, as next-auth just feels like an unnecessary middle man.
I do store additional data about users, i.e their products etc, and use prisma currently, but I dont strictly need next-auth for this....