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
Have you tried adding
skipLibCheck
to your tsconfig.json
?Yes I have it in every single tsconfig I use
you can quickly repro it by setting up both in the same repo
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
all you need is:
and import something from convex-helpers somewhere, and the errors will pop up from within node_modules no matter what settings your tsconfig has
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
Yes @milk enjoyer please share the complete error message, thanks!
it only happens when I have both ts-reset AND convex-helpers installed and configured within the same repo
@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?)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.
@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)I see. Let me try 0.1.20 now and report back. Thanks!
It seems to work now without errors 👍