Jacob
Explore posts from serversCDCloudflare Developers
•Created by Jacob on 8/9/2024 in #workers-help
vite-tsconfig-paths throws error when used in Worker vitest config
Hello, I'm using custom paths inside of my tsconfig, I've tried to make Vitest compatible with them using the vite-tsconfig-paths plugin however it consistently gives me this error ..
Vitest config
Wrangler.toml
2 replies
CDCloudflare Developers
•Created by Jacob on 8/7/2024 in #workers-help
KV Namespace methods break when passed through constructor
Hey everyone,
I'm trying to make my KV namespaces accessible in my services using dep injection with tsyringe. Is this something that is known to be unsupported?
I found that after injecting the kv namespace the put() and get() methods seemingly blocks execution of anything coming after it, without any errors and no data being set or retrieved.
I would prefer for my services to have the kv namespaces available instead of having to pass it from the request handler (hono with trpc) through to my repository class.
I have a middleware for Hono set up like this.
4 replies
Issues with Cloudflare KV
Hey everyone,
I'm trying to make my KV namespaces accessible in my services using dep injection with tsyringe. Is this something that is known to be unsupported?
I found that after injecting the kv namespace the put() and get() methods seemingly blocks execution of anything coming after it, without any errors and no data being set or retrieved.
I would prefer for my services to have the kv namespaces available instead of having to pass it from the request handler (hono with trpc) through to my repository class.
I have a middleware for Hono set up like this.
5 replies
Losing type-safety with merged routers
When using router exported from an external file, I lose any sort of type safety for the procedures on in that router.
router.ts
users.ts
On my frontend I call the trpc object api
api.test
is typed as expected, api.users
however is any
.
I can quite figure out what I'm doing wrong 🤔5 replies