Skip to content

Conversation

@chuckcarpenter
Copy link
Member

Fixes the following error:

ResponseValidationError: Response validation failed
    at safeParseResponse (file:///var/task/dist/server/pages/api/checkout.astro.mjs:1529:20)
    at matchFunc (file:///var/task/dist/server/pages/api/checkout.astro.mjs:1506:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async $do$1Q (file:///var/task/dist/server/pages/api/checkout.astro.mjs:12080:22) {
  statusCode: 201,
  body: '{"id":"d4e107a0-94c9-4111-b607-215de0c35e1a","created_at":"2025-10-29T06:05:20.206574Z","modified_at":null,"custom_field_data":{"ad-product-name":null,"ad-product-desc":null,"ad-product-link":null},"payment_processor":"stripe","status":"open","client_secret":"polar_c_MdCH51XozvfWSZS00YRfMZhaUyg9ZNt7T2Che3aX4Yh","url":"https://polar.sh/checkout/polar_c_MdCH51XozvfWSZS00YRfMZhaUyg9ZNt7T2Che3aX4Yh","expires_at":"2025-10-29T07:05:20.206553Z","success_url":"https://whiskey.fm/sponsor/success?checkoutId=d4e107a0-94c9-4111-b607-215de0c35e1a","return_url":null,"embed_origin":null,"amount":100000,"seats":null,"price_per_seat":null,"discount_amount":0,"net_amount":100000,"tax_amount":null,"total_amount":100000,"currency":"usd","active_trial_interval":null,"active_trial_interval_count":null,"trial_end":null,"product_id":"afa63f48-63a4-45de-a26c-fddc13a4fadb","product_price_id":"c16aee1e-3420-4009-9dbc-17e099670fbd","discount_id":null,"allow_discount_codes":true,"require_billing_address":false,"is_discount_applicable":true,"is_free_product_price":false,"is_payment_required":true,"is_payment_setup_required":false,"is_payment_form_required":true,"customer_id":null,"is_business_customer":false,"customer_name":null,"customer_email":null,"customer_ip_address":null,"customer_billing_name":null,"customer_billing_address":null,"customer_tax_id":null,"payment_processor_metadata":{"publishable_key":"pk_live_51LzIVeDG1jUQrXwC7sH96FM58ydVBDw9KQ1Vaw4lXZFGGFRK3DKBorOPM86PkutdUyLdH7TbwS9QAVWI1igFiVCZ00fGmx9bnF"},"customer_billing_address_fields":{"country":true,"state":false,"city":false,"postal_code":false,"line1":false,"line2":false},"billing_address_fields":{"country":"required","state":"disabled","city":"disabled","postal_code":"disabled","line1":"disabled","line2":"disabled"},"trial_interval":null,"trial_interval_count":null,"metadata":{},"external_customer_id":null,"customer_external_id":null,"products":[{"id":"afa63f48-63a4-45de-a26c-fddc13a4fadb","created_at":"2025-06-13T22:05:13.537700Z","modified_at":"2025-10-08T12:10:42.094495Z","trial_interval":null,"trial_interval_count":null,"name":"60 Second Ad Read","description":"Want to dazzle a crowd of tech nerds and whiskey connoisseurs? Throw your brand into the mix! Our listeners love innovation, good banter, and a stiff drink—so get in on the fun and make some magic happen. Stay classy, sponsor.","recurring_interval":null,"recurring_interval_count":null,"is_recurring":false,"is_archived":false,"organization_id":"0e2bf934-9972-4c0e-8604-4beaf243c44c","prices":[{"created_at":"2025-06-13T22:05:13.541361Z","modified_at":"2025-06-13T22:05:14.013767Z","id":"c16aee1e-3420-4009-9dbc-17e099670fbd","amount_type":"fixed","is_archived":false,"product_id":"afa63f48-63a4-45de-a26c-fddc13a4fadb","type":"one_time","recurring_interval":null,"price_currency":"usd","price_amount":100000}],"benefits":[],"medias":[]}],"product":{"id":"afa63f48-63a4-45de-a26c-fddc13a4fadb","created_at":"2025-06-13T22:05:13.537700Z","modified_at":"2025-10-08T12:10:42.094495Z","trial_interval":null,"trial_interval_count":null,"name":"60 Second Ad Read","description":"Want to dazzle a crowd of tech nerds and whiskey connoisseurs? Throw your brand into the mix! Our listeners love innovation, good banter, and a stiff drink—so get in on the fun and make some magic happen. Stay classy, sponsor.","recurring_interval":null,"recurring_interval_count":null,"is_recurring":false,"is_archived":false,"organization_id":"0e2bf934-9972-4c0e-8604-4beaf243c44c","prices":[{"created_at":"2025-06-13T22:05:13.541361Z","modified_at":"2025-06-13T22:05:14.013767Z","id":"c16aee1e-3420-4009-9dbc-17e099670fbd","amount_type":"fixed","is_archived":false,"product_id":"afa63f48-63a4-45de-a26c-fddc13a4fadb","type":"one_time","recurring_interval":null,"price_currency":"usd","price_amount":100000}],"benefits":[],"medias":[]},"product_price":{"created_at":"2025-06-13T22:05:13.541361Z","modified_at":"2025-06-13T22:05:14.013767Z","id":"c16aee1e-3420-4009-9dbc-17e099670fbd","amount_type":"fixed","is_archived":false,"product_id":"afa63f48-63a4-45de-a26c-fddc13a4fadb","type":"one_time","recurring_interval":null,"price_currency":"usd","price_amount":100000},"discount":null,"subscription_id":null,"attached_custom_fields":[{"custom_field_id":"87e7febb-494c-40f7-a772-d9543b5b31b6","custom_field":{"created_at":"2025-10-17T11:53:51.228705Z","modified_at":"2025-10-17T11:55:34.676002Z","id":"87e7febb-494c-40f7-a772-d9543b5b31b6","metadata":{},"type":"text","slug":"ad-product-name","name":"Product Name","organization_id":"0e2bf934-9972-4c0e-8604-4beaf243c44c","properties":{"form_help_text":"Name to be read on air","form_placeholder":"Name to be read on air"}},"order":0,"required":false},{"custom_field_id":"028602bc-e7da-4ae4-b5ac-64d7205bf824","custom_field":{"created_at":"2025-10-17T11:54:45.391846Z","modified_at":"2025-10-17T11:55:51.422094Z","id":"028602bc-e7da-4ae4-b5ac-64d7205bf824","metadata":{},"type":"text","slug":"ad-product-desc","name":"Tagline","organization_id":"0e2bf934-9972-4c0e-8604-4beaf243c44c","properties":{"form_help_text":"A very short (one sentence) tagline to read with the product name.","form_placeholder":"Product Description","textarea":false}},"order":1,"required":false},{"custom_field_id":"8519bbf1-1287-476b-8bca-aa4a36154fb2","custom_field":{"created_at":"2025-10-17T11:55:19.287891Z","modified_at":"2025-10-17T11:55:44.665147Z","id":"8519bbf1-1287-476b-8bca-aa4a36154fb2","metadata":{},"type":"text","slug":"ad-product-link","name":"Product Link","organization_id":"0e2bf934-9972-4c0e-8604-4beaf243c44c","properties":{"form_help_text":"The link for our show notes","form_placeholder":"The link for our show notes"}},"order":2,"required":false}],"customer_metadata":{},"subtotal_amount":100000}',
  headers: Headers {
    date: 'Wed, 29 Oct 2025 06:05:20 GMT',
    'content-type': 'application/json',
    'content-length': '1643',
    connection: 'keep-alive',
    'cf-ray': '99607b08ebe5d643-IAD',
    'content-encoding': 'br',
    'rndr-id': 'c57454ab-dcc9-4baa',
    vary: 'Accept-Encoding',
    'x-render-origin-server': 'uvicorn',
    'cf-cache-status': 'DYNAMIC',
    server: 'cloudflare',
    'alt-svc': 'h3=":443"; ma=86400'
  },
  contentType: 'application/json',
  rawResponse: Response {
    status: 201,
    statusText: 'Created',
    headers: Headers {
      date: 'Wed, 29 Oct 2025 06:05:20 GMT',
      'content-type': 'application/json',
      'content-length': '1643',
      connection: 'keep-alive',
      'cf-ray': '99607b08ebe5d643-IAD',
      'content-encoding': 'br',
      'rndr-id': 'c57454ab-dcc9-4baa',
      vary: 'Accept-Encoding',
      'x-render-origin-server': 'uvicorn',
      'cf-cache-status': 'DYNAMIC',
      server: 'cloudflare',
      'alt-svc': 'h3=":443"; ma=86400'
    },
    body: ReadableStream { locked: true, state: 'closed', supportsBYOB: true },
    bodyUsed: true,
    ok: true,
    redirected: false,
    type: 'basic',
    url: 'https://api.polar.sh/v1/checkouts/'
  },
  cause: TypeError: Cannot read properties of undefined (reading '_zod')
      at inst._zod.parse (file:///var/task/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.js:1272:46)
      at inst._zod.parse (file:///var/task/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.js:1503:35)
      at eval (eval at compile (file:///var/task/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/doc.js:33:16), <anonymous>:59:49)
      at file:///var/task/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.js:880:34
      at inst._zod.parse (file:///var/task/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.js:905:23)
      at inst._zod.parse (file:///var/task/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.js:1682:34)
      at Module.<anonymous> (file:///var/task/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/parse.js:6:32)
      at inst.parse (file:///var/task/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/schemas.js:27:42)
      at safeParseResponse.request.request (file:///var/task/dist/server/pages/api/checkout.astro.mjs:1506:63)
      at safeParseResponse (file:///var/task/dist/server/pages/api/checkout.astro.mjs:1526:19),
  rawValue: {
    id: 'd4e107a0-94c9-4111-b607-215de0c35e1a',
    created_at: '2025-10-29T06:05:20.206574Z',
    modified_at: null,
    custom_field_data: {
      'ad-product-name': null,
      'ad-product-desc': null,
      'ad-product-link': null
    },
    payment_processor: 'stripe',
    status: 'open',
    client_secret: 'polar_c_MdCH51XozvfWSZS00YRfMZhaUyg9ZNt7T2Che3aX4Yh',
    url: 'https://polar.sh/checkout/polar_c_MdCH51XozvfWSZS00YRfMZhaUyg9ZNt7T2Che3aX4Yh',
    expires_at: '2025-10-29T07:05:20.206553Z',
    success_url: 'https://whiskey.fm/sponsor/success?checkoutId=d4e107a0-94c9-4111-b607-215de0c35e1a',
    return_url: null,
    embed_origin: null,
    amount: 100000,
    seats: null,
    price_per_seat: null,
    discount_amount: 0,
    net_amount: 100000,
    tax_amount: null,
    total_amount: 100000,
    currency: 'usd',
    active_trial_interval: null,
    active_trial_interval_count: null,
    trial_end: null,
    product_id: 'afa63f48-63a4-45de-a26c-fddc13a4fadb',
    product_price_id: 'c16aee1e-3420-4009-9dbc-17e099670fbd',
    discount_id: null,
    allow_discount_codes: true,
    require_billing_address: false,
    is_discount_applicable: true,
    is_free_product_price: false,
    is_payment_required: true,
    is_payment_setup_required: false,
    is_payment_form_required: true,
    customer_id: null,
    is_business_customer: false,
    customer_name: null,
    customer_email: null,
    customer_ip_address: null,
    customer_billing_name: null,
    customer_billing_address: null,
    customer_tax_id: null,
    payment_processor_metadata: {
      publishable_key: 'pk_live_51LzIVeDG1jUQrXwC7sH96FM58ydVBDw9KQ1Vaw4lXZFGGFRK3DKBorOPM86PkutdUyLdH7TbwS9QAVWI1igFiVCZ00fGmx9bnF'
    },
    customer_billing_address_fields: {
      country: true,
      state: false,
      city: false,
      postal_code: false,
      line1: false,
      line2: false
    },
    billing_address_fields: {
      country: 'required',
      state: 'disabled',
      city: 'disabled',
      postal_code: 'disabled',
      line1: 'disabled',
      line2: 'disabled'
    },
    trial_interval: null,
    trial_interval_count: null,
    metadata: {},
    external_customer_id: null,
    customer_external_id: null,
    products: [ [Object] ],
    product: {
      id: 'afa63f48-63a4-45de-a26c-fddc13a4fadb',
      created_at: '2025-06-13T22:05:13.537700Z',
      modified_at: '2025-10-08T12:10:42.094495Z',
      trial_interval: null,
      trial_interval_count: null,
      name: '60 Second Ad Read',
      description: 'Want to dazzle a crowd of tech nerds and whiskey connoisseurs? Throw your brand into the mix! Our listeners love innovation, good banter, and a stiff drink—so get in on the fun and make some magic happen. Stay classy, sponsor.',
      recurring_interval: null,
      recurring_interval_count: null,
      is_recurring: false,
      is_archived: false,
      organization_id: '0e2bf934-9972-4c0e-8604-4beaf243c44c',
      prices: [Array],
      benefits: [],
      medias: []
    },
    product_price: {
      created_at: '2025-06-13T22:05:13.541361Z',
      modified_at: '2025-06-13T22:05:14.013767Z',
      id: 'c16aee1e-3420-4009-9dbc-17e099670fbd',
      amount_type: 'fixed',
      is_archived: false,
      product_id: 'afa63f48-63a4-45de-a26c-fddc13a4fadb',
      type: 'one_time',
      recurring_interval: null,
      price_currency: 'usd',
      price_amount: 100000
    },
    discount: null,
    subscription_id: null,
    attached_custom_fields: [ [Object], [Object], [Object] ],
    customer_metadata: {},
    subtotal_amount: 100000
  },
  rawMessage: 'Response validation failed'
}

@vercel
Copy link

vercel bot commented Oct 29, 2025

@chuckcarpenter is attempting to deploy a commit to the shipshapecode Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants