next-s3-upload icon indicating copy to clipboard operation
next-s3-upload copied to clipboard

I got an error with Cloudflare R2

Open imvinojanv opened this issue 4 months ago • 0 comments

I followed the documentation to configure with Cloudflare R2, some errors are showing on the terminal.

import { APIRoute } from "next-s3-upload";

export default APIRoute.configure({
    accessKeyId: process.env.CLOUDFLARE_R2_ACCESS_KEY_ID,
    secretAccessKey: process.env.CLOUDFLARE_R2_SECRET_ACCESS_KEY,
    bucket: process.env.CLOUDFLARE_R2_BUCKET_NAME,
    region: "ap-southeast-1",
    endpoint: "`https://${process.env.CLOUDFLARE_R2_ACCOUNT_ID}.r2.cloudflarestorage.com`"
});

ERROR: ⨯ Detected default export in 'D:\Documents\Next Projects\nextjs-s3-server-actions\app\api\cloudflare-next-s3-upload\route.ts'. Export a named export for each HTTP method instead. ⨯ No HTTP methods exported in 'D:\Documents\Next Projects\nextjs-s3-server-actions\app\api\cloudflare-next-s3-upload\route.ts'. Export a named export for each HTTP method.

Would anyone be able to fix this error?

imvinojanv avatar Oct 01 '24 05:10 imvinojanv