[Bug]: Error when calling importTransactions() using @actual-app/api #316

Closed
opened 2026-02-28 18:58:39 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @callumgare on GitHub (Mar 27, 2023).

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

The error TypeError: connection.getNumClients is not a function is thrown when the importTransactions() function is called. I have made a reproduction script to demonstrate:

git clone https://github.com/callumgare/actual-budget-api-bug
cd actual-budget-api-bug
npm install && env AB_SERVER_URL=%%%% AB_PASSWORD=%%%% AB_SYNC_ID=%%%% AB_ACCOUNT_ID=%%%% node index.js

What error did you receive?

Downloading ActualBudget cache locally
Loaded spreadsheet from cache (728 items)
Syncing since 2023-03-27T01:26:54.671Z-000D-be5c0596146a96e1 23 (attempt: 0)
Got messages from server 0
/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46286
            if (connection.getNumClients() > 1) {
                           ^

TypeError: connection.getNumClients is not a function
    at _callee$ (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46286:28)
    at tryCatch (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46235:1357)
    at Generator.<anonymous> (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46235:4174)
    at Generator.next (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46235:2208)
    at asyncGeneratorStep (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46236:103)
    at _next (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46237:194)

Node.js v19.5.0

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Other

Operating System

Mac OSX

Originally created by @callumgare on GitHub (Mar 27, 2023). ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### What happened? The error `TypeError: connection.getNumClients is not a function` is thrown when the importTransactions() function is called. I have made a reproduction script to demonstrate: ```shell git clone https://github.com/callumgare/actual-budget-api-bug cd actual-budget-api-bug npm install && env AB_SERVER_URL=%%%% AB_PASSWORD=%%%% AB_SYNC_ID=%%%% AB_ACCOUNT_ID=%%%% node index.js ``` ### What error did you receive? ``` Downloading ActualBudget cache locally Loaded spreadsheet from cache (728 items) Syncing since 2023-03-27T01:26:54.671Z-000D-be5c0596146a96e1 23 (attempt: 0) Got messages from server 0 /private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46286 if (connection.getNumClients() > 1) { ^ TypeError: connection.getNumClients is not a function at _callee$ (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46286:28) at tryCatch (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46235:1357) at Generator.<anonymous> (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46235:4174) at Generator.next (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46235:2208) at asyncGeneratorStep (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46236:103) at _next (/private/tmp/test/node_modules/@actual-app/api/app/bundle.api.js:46237:194) Node.js v19.5.0 ``` ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Other ### Operating System Mac OSX
GiteaMirror added the bug label 2026-02-28 18:58:39 -06:00
Author
Owner

@j-f1 commented on GitHub (Mar 27, 2023):

Thanks for making the reproducer! I was able to track down the problem and it should be fixed by https://github.com/actualbudget/actual/pull/819.

@j-f1 commented on GitHub (Mar 27, 2023): Thanks for making the reproducer! I was able to track down the problem and it should be fixed by https://github.com/actualbudget/actual/pull/819.
Author
Owner

@callumgare commented on GitHub (Mar 28, 2023):

Amazing turn around time! Thanks 😊

@callumgare commented on GitHub (Mar 28, 2023): Amazing turn around time! Thanks 😊
Author
Owner

@callumgare commented on GitHub (Apr 7, 2023):

Just wondering if you have any idea when a new version of https://www.npmjs.com/package/@actual-app/api might be pushed which would include this change? Ta

@callumgare commented on GitHub (Apr 7, 2023): Just wondering if you have any idea when a new version of https://www.npmjs.com/package/@actual-app/api might be pushed which would include this change? Ta
Author
Owner

@callumgare commented on GitHub (Apr 7, 2023):

I've just noticed that the release notes for the actually app mention that it was fixed in 23.3.0 (https://actualbudget.github.io/docs/Release-Notes/) but this is for the api package so not sure what the situation is.

@callumgare commented on GitHub (Apr 7, 2023): I've just noticed that the release notes for the actually app mention that it was fixed in 23.3.0 (https://actualbudget.github.io/docs/Release-Notes/) but this is for the api package so not sure what the situation is.
Author
Owner

@j-f1 commented on GitHub (Apr 7, 2023):

Good catch, pinged Matiss who has the ability to release an update to the API package. API releases are currently not connected to app releases, but we might want to consider changing that in the future.

@j-f1 commented on GitHub (Apr 7, 2023): Good catch, pinged Matiss who has the ability to release an update to the API package. API releases are currently not connected to app releases, but we might want to consider changing that in the future.
Author
Owner

@j-f1 commented on GitHub (Apr 7, 2023):

Give 5.1.1 a shot :)

@j-f1 commented on GitHub (Apr 7, 2023): Give 5.1.1 a shot :)
Author
Owner

@callumgare commented on GitHub (Apr 7, 2023):

Fantastic, thanks again!

@callumgare commented on GitHub (Apr 7, 2023): Fantastic, thanks again!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#316