Hmmmmm the `getRequestContext` can't be
Hmmmmm the
getRequestContext
can't be called within an actions.ts due to edge runtime requirement. Gana have to find another way to populate data to a client component.9 Replies
I feel like you can use
getRequestContext
no problem from actions.ts
as long as actions.ts
is only imported from routes using the edge runtime.... I might be wrong though 😕so i have to do more testing but it seems like having a client component call an action using
getRequestContext
works when the client component is being called/rendered from a route using edge runtimecurrently not sure why im getting this ts error. I get the env variable so thats fine.
env.d.ts
ok that sounds promising 😄
I wonder if your
.d.ts
file being picked up correctly 🤔
naturally I guess you tried reloading the TS server/IDE right?the IDE im using is jetbrains' WebStorm, restarted it and restarted typescript service. Both times TS hasnt picked it up
do you have any imports in your d.ts file by any chance?
i had D1Databas type imported, removed it and it fixed
Appreciate the help as always!
no problem! 😄