goshippo / shippo-javascript-sdk

MIT License
5 stars 0 forks source link

Error in getting rates when using customs declaration string #20

Closed gautamsi closed 2 months ago

gautamsi commented 2 months ago

When trying to get Rate by setting customsDeclaration: 'UUID' it throws err. Error

 "name": "SDKValidationError",
    "cause": {
        "issues": [
            {
                "code": "invalid_type",
                "expected": "string",
                "received": "object",
                "path": [
                    "customs_declaration"
                ],
                "message": "Expected string, received object"
            }
        ],
        "name": "ZodError"
    },

when looking at the response, it does return the customs_declaration as object

shippo-lueders commented 2 months ago

well, I have good news and bad new for you :)

the good news is, this particular issue has been addressed and a new artifact published - https://www.npmjs.com/package/shippo/v/2.2.1

the bad news is, if you try to execute the same call with the updated artifact, you will 100% run into the issue reported here

that other issue will hopefully be fixed by tomorrow, otherwise I'll update the issue with an ETA

gautamsi commented 2 months ago

I patched both to change zod schema to z.any using yarn patch for time being.