stillmotion
stillmotion
Explore posts from servers
CDCloudflare Developers
Created by stillmotion on 3/22/2024 in #workers-help
Next.js getPlatformProxy R2 binding not uploading to bucket?
When using the getPlatformProxy in Next.js via the @cloudflare/next-on-pages/next-dev monkey patch, calls to upload a file to my bound R2 bucket do not upload files to the actual bucket. Is this expected behavior or do I have a configuration error?
const result = await getRequestContext().env.BUCKET_NAME.put(key, buffer)
const result = await getRequestContext().env.BUCKET_NAME.put(key, buffer)
printing result, all fields of the object are undefined. The .wrangler directory does cache the upload in one of its subdirectories, however.
3 replies
TTCTheo's Typesafe Cult
Created by stillmotion on 8/22/2023 in #questions
Why does vercel strip out authorization headers?
Just noticed that vercel in production places my request's authorization headers under x-vercel-sc-headers. Googling for this is a bit overwhelming tbh, lots of different articles but no specific mention of that specific header key. Was wondering if someone could point me in the right direction to fix this quickly? Thanks!
2 replies
TTCTheo's Typesafe Cult
Created by stillmotion on 5/10/2023 in #questions
Exporting prisma types from turborepo package
Referencing the packages/db package in the create t3 turbo repo, the index.ts file re-exports all the named exports from @prisma/client (export * from "@prisma/client"). I can import the generated prisma models just fine, but I can't seem to import the types. Are types exported with the wildcard re-export?
3 replies
TTCTheo's Typesafe Cult
Created by stillmotion on 5/8/2023 in #questions
Error: npm lint not seeing env type
I converted my existing project over to use the same template as ct3a. However, when I run npm run lint it throws a @typescript-eslint/no-unsafe-member-access error for every place in my codebase where I import { env } from "~/env.mjs", saying env is an any type. I can't seem to figure out what is causing this, since vscode still shows the env type when I hover over the import and I've double checked that my eslintrc.cjs and tsconfig.json are setup correctly.
18 replies