nl7
Explore posts from serversDeno LSP trouble with Hono Validators
I'm trying to write a simple Hono app and I'm having trouble getting validators to work. It seems when I add validator middleware to a route, the context loses most inferred type information and the LSP gives me a TS 2769 Error saying that no overloads match.
1 replies
Deno + TSServer weirdness
I'm new to Deno and have had a frustrating introduction to Deno. When I would import libraries into my Deno project, any nested types that weren't explicitly imported lost their typing, resulting in an any type. This ended up only applying to a small portion of my code, but it was enough to drive me nuts.
To be more specific, I'm building a Hono app to deploy on Deno Deploy, and the context parameter is showing up as any type. I had a hunch that maybe Deno LSP & TSServer were interacting in some way and decided to disable TSServer, and the correct type showed up!
I was able to get types working correctly without completely disabling TSServer by adding
"typescript.disableAutomaticTypeAcquisition": true,
to my deno.json file.
I'm not sure if other people are going through this or not but I found this to be a very frustrating experience. I think the docs need to be updated. The interaction between Deno LSP & TSServer is probably going to bite some users and this is not show up on any telemetry collected from users.3 replies
CDCloudflare Developers
•Created by nl7 on 4/19/2024 in #workers-help
Models giving irrelevant responses
1 replies