Yunis
Yunis
TTCTheo's Typesafe Cult
Created by Yunis on 5/27/2023 in #questions
Using database-js to test Lambda function locally
So... I have a lambda function which should connect to Planetscale on prod. When developing locally, I want to connect to my localhost database. I also test my lambda function locally using serverless invoke local (https://www.serverless.com/framework/docs/providers/aws/cli-reference/invoke-local). Am I choosing the wrong approach here? How do you test your Lambda functions locally?
2 replies
TTCTheo's Typesafe Cult
Created by Yunis on 5/24/2023 in #questions
Struggling to add client-side environment variables
I am trying to add a client-side env variable to my env.mjs... I added it to the .env file, like so: FOO_URL=https://example.com/ Then I went to env.mjs and added it to client object like so: client: { NEXT_PUBLIC_FOO_URL: z.string().min(1), }, and also to the runtimeEnvobject like so: runtimeEnv: { NEXT_PUBLIC_FOO_URL: process.env.FOO_URL, }, When running the app I get: Unhandled Runtime Error Error: Invalid environment variables What am I missing?
4 replies
TTCTheo's Typesafe Cult
Created by Yunis on 5/9/2023 in #questions
Component re-renders after state change, tRPC query not executed again?
I have a component where I render out a table. Each row has a checkbox. Each checked row can be deleted. I am using tRPC to query and paginate the data in the table and also to delete the rows using Prisma. After deleting the checked rows, I want the table to re-render and display the items minus the ones previously deleted. Everything tRPC-ish works (I think). The component get's re-rendered after the mutation, but I the table only get's updated after I switch windows (i.e. bringing VSCode in the front, then back to Chrome). What is causing this behaviour? Am I missing something using on the tRPC side of things?
8 replies