JudgeJLo
Explore posts from serversPPrisma
•Created by JudgeJLo on 5/1/2024 in #help-and-questions
invalid invocation prisma.paypal.findMany()
I'm quite confused by this error since it only happens at runtime when deployed. Cannot recreate locally. We have a findMany query that is throwing this error:
Error converting field "date" of expected non-nullable type "String", found incompatible value of "2024-04-28 00:00:00 +00:00"
This is the model:
This query just returns all records and sorts so newest is first. I've tested with and without the orderBy directive and the result is the same. Here is the query:
javascript
3 replies
TTCTheo's Typesafe Cult
•Created by JudgeJLo on 4/16/2024 in #questions
Issues with Clerk and Unit testing
I am working on a project for work and we have a strict requirement for unit tests. I decided to go with Vitest and we're using Clerk for auth. I ran into two different issues and I'm not sure which path is easier to solve. When I run the test (one so far) using the render method from @testing-library/react I get an error that "AuthContext not found". That made sense so I used a pattern I've used elsewhere of making a wrapper for render that wraps all children in a ClerkProvider.
When I do that I get a new error that says
ClerkProvider.js 2 seems to be an ES Module but shipped in a CommonJS package. You might want to create an issue to the package "@clerk/nextjs" asking them to ship the file in .mjs extension or add "type": "module" in their package.json.
I'm unsure how to proceed as the only issue I currently have with Clerk is that they have zero guidance on how to set up any tests within the auth context. Hoping someone has encountered this and has a pointer towards a solve.3 replies
TTCTheo's Typesafe Cult
•Created by JudgeJLo on 2/12/2024 in #questions
Inferring types from Prisma schema for Zod input
I can’t find this in any of the docs, but I feel like there has to be a way. Instead of redefining each property on an input I want to define it as a type I’m already using elsewhere that was generated by Prisma. Infer uses an actual value to do this, not a type. Is there a way to do this using the type?
2 replies
TTCTheo's Typesafe Cult
•Created by JudgeJLo on 6/18/2023 in #questions
SKIP_ENV_VALIDATION
I have this set to 'true' in my .env but I'm still getting errors about missing envs (they aren't missing and have another question open about why) but my understanding would be that this should skip such a check and therefore should make seeing that error impossible.
5 replies
TTCTheo's Typesafe Cult
•Created by JudgeJLo on 6/18/2023 in #questions
Invalid Environment Variables
16 replies