Tilo
Explore posts from serversCDCloudflare Developers
•Created by Tilo on 2/19/2024 in #pages-help
Sveltekit does not get the platform variable when processing api request
Hello I have a Cloudflare Pages App using Sveltekit and I want to integrate R2.
I have configured my wrangler.toml
I setup my src/app.d.ts:
I'm running the server through this command:
npx wrangler pages dev --proxy 5174 -- npm run dev -- --port 5174
And this is my endpoint
But event.platform is always undefined, no matter how I start the server, even when I deploy a preview build I do not have platform set.
Does anyone have an idea how to fix this, your help would be greatly appreciated.5 replies
TTCTheo's Typesafe Cult
•Created by Tilo on 4/19/2023 in #questions
Passing a object with readonly attributes through tRPC
I have a class (provided by a library)
I want to send this / the data of the readonly attributes to the client, but either while sending it directly or while destructing the object everything get's prefixed with and underscore (because it is private and readonly I think ?). The problem is if I try to access this data on the client Typescript will throw an error because the attribute is "private".
How can I clone this data and or send it so that I can access it on the client ?
9 replies