diff --git a/app/api/skatteverket/tax-payments/[period]/payment-file/route.ts b/app/api/skatteverket/tax-payments/[period]/payment-file/route.ts index 6efce6a7..8c07d728 100644 --- a/app/api/skatteverket/tax-payments/[period]/payment-file/route.ts +++ b/app/api/skatteverket/tax-payments/[period]/payment-file/route.ts @@ -218,7 +218,9 @@ export const GET = withRouteContext<{ params: Promise<{ period: string }> }>( .eq('id', agi.id) .eq('company_id', companyId) - return new Response(fileContent, { + // Buffer is not assignable to BodyInit under the strict build tsconfig + // (Buffer); the repo convention is a Uint8Array view. + return new Response(new Uint8Array(fileContent), { headers: { 'Content-Type': contentType, 'Content-Disposition': `attachment; filename="${filename}"`,