DurableObjectNamespace losing its type?
I have a
worker-configuration.d.ts
that looks like this:
I also have "types": ["@remix-run/cloudflare", "@cloudflare/workers-types"],
in my tsconfig.json
so that Env
is available everywhere in my app. However, Env["CHATSTORE"]
shows up as DurableObjectNamespace<any>
everywhere, instead of DurableObjectNamespace<ChatStore>
. How do I get that type to not devolve to any
?4 Replies
Is
worker-configuration
in your src
?It's in my project root. (I'm in a remix app). The
./build/index
path is correct relative to the file
if i manually change it to: then it works, but this file is automatically generated, and the next time i run wrangler types
it would get blown away
also, this is include
from my tsconfig:
for now, i just added a env.d.ts
file, and put this in it:
i think since it comes after the worker-configuration in my tsconfig, it loads after and augments Env
with the correct type
never mind, still doesn't workSorry I meant the src of your tsconfig