[GH-ISSUE #7410] [Bug]: Type errors in latest API package #44733

Closed
opened 2026-04-26 06:36:41 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @NikxDa on GitHub (Apr 7, 2026).
Original GitHub issue: https://github.com/actualbudget/actual/issues/7410

What happened?

I run a pipeline monthly when Actual publishes to publish a new version of my tool dependent on Actual. Previously this all worked great, but running tsc on the latest package produces quite a large number of errors.

Image

See the pipeline run here:
https://github.com/NikxDa/actual-moneymoney/actions/runs/24076684303/job/70226779702

How can we reproduce the issue?

Run npx tsc --noEmit on the source code of Actual's API package.

Where are you hosting Actual?

None

What browsers are you seeing the problem on?

No response

Operating System

None

Originally created by @NikxDa on GitHub (Apr 7, 2026). Original GitHub issue: https://github.com/actualbudget/actual/issues/7410 ### What happened? I run a pipeline monthly when Actual publishes to publish a new version of my tool dependent on Actual. Previously this all worked great, but running `tsc` on the latest package produces quite a large number of errors. <img width="2230" height="1080" alt="Image" src="https://github.com/user-attachments/assets/ec0c2744-cccd-4e50-b8e7-186fb5e224b2" /> See the pipeline run here: https://github.com/NikxDa/actual-moneymoney/actions/runs/24076684303/job/70226779702 ### How can we reproduce the issue? Run `npx tsc --noEmit` on the source code of Actual's API package. ### Where are you hosting Actual? None ### What browsers are you seeing the problem on? _No response_ ### Operating System None
GiteaMirror added the APIbug labels 2026-04-26 06:36:42 -05:00
Author
Owner

@matt-fidd commented on GitHub (Apr 7, 2026):

I can't replicate this. Have you tried yarn build in the api package? I believe it now depends on types generated in other packages

Mac:actual:master% npx tsc --noEmit
Mac:actual:master% echo $?
0
<!-- gh-comment-id:4200014933 --> @matt-fidd commented on GitHub (Apr 7, 2026): I can't replicate this. Have you tried `yarn build` in the api package? I believe it now depends on types generated in other packages ``` Mac:actual:master% npx tsc --noEmit Mac:actual:master% echo $? 0 ```
Author
Owner

@NikxDa commented on GitHub (Apr 7, 2026):

I wondered if it had to do with tsconfig changes, but if there were changes made to the way that types are generated maybe it is my pipeline that's broken. I just didn't expect this to break this bad from a monthly version bump. I can dig in and see if I get different results when I try to build with yarn first.

<!-- gh-comment-id:4200113091 --> @NikxDa commented on GitHub (Apr 7, 2026): I wondered if it had to do with tsconfig changes, but if there were changes made to the way that types are generated maybe it is my pipeline that's broken. I just didn't expect this to break this bad from a monthly version bump. I can dig in and see if I get different results when I try to build with yarn first.
Author
Owner

@matt-fidd commented on GitHub (Apr 7, 2026):

I think it changed in 26.4 to pull in changes from loot-core directly instead of inlining them. If I had to guess, this is the best PR to look at https://github.com/actualbudget/actual/pull/6809/, along with https://github.com/actualbudget/actual/pull/7209

<!-- gh-comment-id:4200145181 --> @matt-fidd commented on GitHub (Apr 7, 2026): I think it changed in 26.4 to pull in changes from loot-core directly instead of inlining them. If I had to guess, this is the best PR to look at https://github.com/actualbudget/actual/pull/6809/, along with https://github.com/actualbudget/actual/pull/7209
Author
Owner

@njrun1804 commented on GitHub (Apr 7, 2026):

Hitting the same thing in a separate downstream consumer (a TypeScript MCP server that depends on @actual-app/api with strict: true).

Mechanism: @actual-app/core@26.4.0 ships raw .ts source via its exports map (e.g. "./shared/transactions": "./src/shared/transactions.ts"), not compiled .d.ts. With #7209 removing the inline-loot-core-types.mjs step, @actual-app/api's index.d.ts now re-exports through @actual-app/core, so consumers' tsc follows the chain into core's source files.

skipLibCheck does not help here — it only skips declaration files, not .ts source. The errors I see are upstream strict-mode violations in @actual-app/core/src/shared/{schedules,transactions,util}.ts and @actual-app/core/src/types/api-handlers.ts (implicit any, possibly-null indexing, CJS/ESM uuid import mismatch).

Reproduction: any consumer with tsconfig.compilerOptions.strict: true that imports from @actual-app/api@26.4.0. Pinning back to 26.3.0 restores a clean build.

<!-- gh-comment-id:4201185729 --> @njrun1804 commented on GitHub (Apr 7, 2026): Hitting the same thing in a separate downstream consumer (a TypeScript MCP server that depends on `@actual-app/api` with `strict: true`). Mechanism: `@actual-app/core@26.4.0` ships raw `.ts` source via its exports map (e.g. `"./shared/transactions": "./src/shared/transactions.ts"`), not compiled `.d.ts`. With #7209 removing the `inline-loot-core-types.mjs` step, `@actual-app/api`'s `index.d.ts` now re-exports through `@actual-app/core`, so consumers' `tsc` follows the chain into core's source files. `skipLibCheck` does not help here — it only skips declaration files, not `.ts` source. The errors I see are upstream strict-mode violations in `@actual-app/core/src/shared/{schedules,transactions,util}.ts` and `@actual-app/core/src/types/api-handlers.ts` (implicit `any`, possibly-null indexing, CJS/ESM `uuid` import mismatch). Reproduction: any consumer with `tsconfig.compilerOptions.strict: true` that imports from `@actual-app/api@26.4.0`. Pinning back to `26.3.0` restores a clean build.
Author
Owner

@s-stefanov commented on GitHub (Apr 10, 2026):

Having the same problem. Any indication when the fix will be merged? I see there is already commits from @MatissJanis

Thank you!

<!-- gh-comment-id:4222587240 --> @s-stefanov commented on GitHub (Apr 10, 2026): Having the same problem. Any indication when the fix will be merged? I see there is already commits from @MatissJanis Thank you!
Author
Owner

@TheFehr commented on GitHub (Apr 10, 2026):

I solved it temporarily by using require on the compiled js files. And typing the handful of functions I call manually:
https://github.com/TheFehr/n8n-nodes-actual/pull/68/changes#diff-14a5cb97c216f30a9e34d1c5019f71f196f0b4574c696c539a814a8714e397a7R10-R14
https://github.com/TheFehr/n8n-nodes-actual/pull/68/changes#diff-fdf9bc98f1f10d23cf1dec23a30a37ad7a845fa3266d192a2514070e3f18aa7d

Very ugly solution, but this way I could update my downstream package.

<!-- gh-comment-id:4224046633 --> @TheFehr commented on GitHub (Apr 10, 2026): I _solved_ it temporarily by using `require` on the compiled js files. And typing the handful of functions I call manually: https://github.com/TheFehr/n8n-nodes-actual/pull/68/changes#diff-14a5cb97c216f30a9e34d1c5019f71f196f0b4574c696c539a814a8714e397a7R10-R14 https://github.com/TheFehr/n8n-nodes-actual/pull/68/changes#diff-fdf9bc98f1f10d23cf1dec23a30a37ad7a845fa3266d192a2514070e3f18aa7d Very ugly solution, but this way I could update my downstream package.
Author
Owner

@MatissJanis commented on GitHub (Apr 10, 2026):

I plan to get to this over the weekend

<!-- gh-comment-id:4225418139 --> @MatissJanis commented on GitHub (Apr 10, 2026): I plan to get to this over the weekend
Author
Owner

@MatissJanis commented on GitHub (Apr 11, 2026):

https://github.com/actualbudget/actual/pull/7468 should do the trick. Would appreciate some eyes on it.

<!-- gh-comment-id:4229440617 --> @MatissJanis commented on GitHub (Apr 11, 2026): https://github.com/actualbudget/actual/pull/7468 should do the trick. Would appreciate some eyes on it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#44733