How to solve this `Failed to encode CBOR: RangeError` error? (never happened in local)

It sounds like you’re hitting a CBOR encoding error that only appears outside your local environment, which usually points to differences in data formatting, environment settings, or dependencies between local and deployed setups. A few things to check: make sure the data you’re encoding doesn’t contain undefined or circular values, verify that the versions of your CBOR libraries match in both environments, and confirm that any environment-specific config (like NODE_ENV or serialization settings) isn’t affecting the input. Logging the exact value that triggers the failure can also help pinpoint what’s causing the range error.
For more context, there’s a related thread on the same forum about serializing objects into CBOR in Motoko that might help you understand how CBOR encoding should be structured when making requests: https://forum.dfinity.org/t/how-do-i-serialize-an-object-into-cbor-format-in-motoko/26739/12