milk enjoyer
milk enjoyer11mo ago

convex-helpers throws errors when "@total-typescript/ts-reset" is used

I know this might be a pretty niche case, but @total-typescript/ts-reset is quite a popular library used by many developers. It throws errors from within node_modules, by the way, even though tsconfig explicitly ignores node_modules. You can repro this by using both libs in a fresh project. The easy solution (which I am using) is to manually copy over the helper functions that are useful from the repo into my project, but of course downloading it as a package would be more convenient.
14 Replies
Michal Srb
Michal Srb11mo ago
Have you tried adding skipLibCheck to your tsconfig.json?
milk enjoyer
milk enjoyerOP11mo ago
Yes I have it in every single tsconfig I use you can quickly repro it by setting up both in the same repo
milk enjoyer
milk enjoyerOP11mo ago
GitHub
GitHub - total-typescript/ts-reset: A 'CSS reset' for TypeScript, i...
A 'CSS reset' for TypeScript, improving types for common JavaScript API's - total-typescript/ts-reset
milk enjoyer
milk enjoyerOP11mo ago
all you need is:
import "@total-typescript/ts-reset";
import "@total-typescript/ts-reset";
and import something from convex-helpers somewhere, and the errors will pop up from within node_modules no matter what settings your tsconfig has
FleetAdmiralJakob 🗕 🗗 🗙
I also use total-typescript in this project: https://github.com/The-Creative-Programming-Group/Weather-App and it is not failing. Maybe you could give a more in depth explanation of the type error or something @milk enjoyer
GitHub
GitHub - The-Creative-Programming-Group/Weather-App: The best weath...
The best weather app that's 100% OSS, collects no data and not showing any ads - The-Creative-Programming-Group/Weather-App
Michal Srb
Michal Srb11mo ago
Yes @milk enjoyer please share the complete error message, thanks!
milk enjoyer
milk enjoyerOP11mo ago
No description
milk enjoyer
milk enjoyerOP11mo ago
it only happens when I have both ts-reset AND convex-helpers installed and configured within the same repo
Michal Srb
Michal Srb11mo ago
@milk enjoyer can you share the code using convex-helpers? Just installing the packages doesn't surface the error. (also which command do you run to see the error?)
milk enjoyer
milk enjoyerOP11mo ago
No commands are needed; just leave it for a few minutes, and the errors start to surface. I am using convex helpers to create custom queries/mutations/actions, and also use the zod helpers a lot since I define all my schema tables and my args using Zod.
No description
milk enjoyer
milk enjoyerOP11mo ago
No description
milk enjoyer
milk enjoyerOP11mo ago
No description
ian
ian11mo ago
@milk enjoyer I couldn't reproduce it, but I just pushed 0.1.20 that fixes the unknown type errors in the zod.ts file. It was doing JSON.parse and not casting unknown to anything before passing to ConvexError which expects a Value (which is any JSON-supported value)
milk enjoyer
milk enjoyerOP11mo ago
I see. Let me try 0.1.20 now and report back. Thanks! It seems to work now without errors 👍

Did you find this page helpful?