Skip to content

Conversation

@AmirL
Copy link
Contributor

@AmirL AmirL commented Jan 10, 2026

Problem

XLSX file import fails on some devices with error: aei[cTZ(0x33ad)] is not a function

The plugin works fine in dev mode but fails on actual devices.

Solution

Add blobToArrayBuffer() helper with fallback strategies for environments where Blob.prototype.arrayBuffer() may not be available:

  1. Try native blob.arrayBuffer()
  2. Fall back to ZenMoney.Blob polyfill's _getBytes()
  3. Wrap native Blob with ZenMoney.Blob if needed

Includes logging to help diagnose which path is used.

Add blobToArrayBuffer() helper function with multiple fallback strategies
to support environments where Blob.prototype.arrayBuffer() is not available.

The function tries:
1. Native blob.arrayBuffer() method
2. ZenMoney.Blob polyfill's _getBytes() if blob is already wrapped
3. Wrapping native Blob with ZenMoney.Blob and using _getBytes()

This fixes XLSX file import failures on devices running older versions
of the Zenmoney app where the breaking change in commit 01f30a6
caused native Blob objects to be returned without the arrayBuffer() polyfill.
@AmirL
Copy link
Contributor Author

AmirL commented Jan 10, 2026

Hi @skvav

This is the commit potentially caused the issue with importing XLS files: 01f30a6

@skvav
Copy link
Member

skvav commented Jan 12, 2026

@AmirL Hi! Maybe the native blobs function .bytes() => Promise can help? It's supported in the new native blob format. We'll restore .arrayBuffer() in the next application release as well.

@AmirL
Copy link
Contributor Author

AmirL commented Jan 12, 2026

@AmirL Hi! Maybe the native blobs function .bytes() => Promise can help? It's supported in the new native blob format. We'll restore .arrayBuffer() in the next application release as well.

Don't know. I didn't test it on a real device, but I hope that the PR can fix it anyway. Do you mind merging it?

@AmirL
Copy link
Contributor Author

AmirL commented Jan 15, 2026

Hi @skvav

Would you mind merging it?

@skvav
Copy link
Member

skvav commented Jan 16, 2026

@AmirL This bug with Blob will be fixed in the next app release in several days. Please wait and we'll check it then.

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