Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while entering Billing Address #17

Open
alepodj opened this issue Jan 25, 2025 · 1 comment
Open

Error while entering Billing Address #17

alepodj opened this issue Jan 25, 2025 · 1 comment

Comments

@alepodj
Copy link

alepodj commented Jan 25, 2025

Hello @rpuls

Amazing work on this railway setup and template i must say.

Wondering if you are able to help me with understanding the following error that occurs while adding information to the Billing address fields on the user pofiles.

Image

Invalid request: Expected type: 'string' for field 'first_name', got: 'null'; Expected type: 'string' for field 'last_name', got: 'null'; Expected type: 'string' for field 'phone', got: 'null'

34.82.65.249 - - [25/Jan/2025:02:43:02 +0000] "POST /store/customers/me/addresses/undefined HTTP/1.1" 400 228 "-" "node"
{
  "severity": "error",
  "timestamp": "2025-01-25T05:32:39.618437630Z",
  "message": "Invalid request: Expected type: 'string' for field 'first_name', got: 'null'; Expected type: 'string' for field 'last_name', got: 'null'; Expected type: 'string' for field 'phone', got: 'null'",
  "tags": {
    "deploymentId": "0095f546-b014-43a5-a610-f2d44a34837a",
    "deploymentInstanceId": "0e633915-4123-4923-a3f0-8f0452be3437",
    "environmentId": "bb23f42d-c1f3-4d5e-b31f-607dcbcc2d8b",
    "pluginId": null,
    "projectId": "99b3d50d-a9c6-4d0c-9987-7b04ebb8dd36",
    "serviceId": "88f4f383-938b-454a-a1ed-715a9eae1faa",
    "snapshotId": null
  },
  "attributes": {
    "level": "error",
    "stack": [
      {
        "columnNumber": 13,
        "fileName": "/app/.medusa/server/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_@mi_wngcg4f2wl6s4hqgbfhvyo22ci/node_modules/@medusajs/framework/src/zod/zod-helpers.ts",
        "functionName": "zodValidator",
        "lineNumber": 126,
        "methodName": null,
        "native": false,
        "typeName": null
      },
      {
        "columnNumber": 5,
        "fileName": "node:internal/process/task_queues",
        "functionName": "processTicksAndRejections",
        "lineNumber": 105,
        "methodName": null,
        "native": false,
        "typeName": null
      },
      {
        "columnNumber": 27,
        "fileName": "/app/.medusa/server/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_@mi_wngcg4f2wl6s4hqgbfhvyo22ci/node_modules/@medusajs/framework/src/http/utils/validate-body.ts",
        "functionName": "async validateBody",
        "lineNumber": 30,
        "methodName": null,
        "native": false,
        "typeName": null
      }
    ],
    "timestamp": "2025-01-25 05:32:39"
  }
}

Everything else on the template works flawlessly so far.

Thanks in advance

@rpuls
Copy link
Owner

rpuls commented Jan 25, 2025

Thanks for the detailed description of the issue ! 🙂
I must be honest and say that this was a until now unexplored area of the app - I never tried adding billing address to the customer profile.

However, I was perfectly able to reproduce the issue you describe, and I think .... but not 100% sure, that my storefront is out of date with the billing address datamodel (I don't know if pulling a fresh storefront, will come with an updated billing form, that matches the schema, but this is something I will try in thea near future when I have time)

If the latest official storefront also has this bug, then the issue should be created in the official medusa repo: https://github.com/medusajs/nextjs-starter-medusa/issues - but let's not get ahead of ourselves here, I will (hopefully soon) do the experiment described above, and hopefully that will lead to a solution - in that case I will just update the boilerplate repo with a fix, and you can merge my commit into your repo. ✌️

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

No branches or pull requests

2 participants