[Bug]: yarn4 projects using @actual/API fail to build #2585

Closed
opened 2026-02-28 20:20:06 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @thromer on GitHub (Nov 1, 2025).

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

yarn4 projects that depend on @actual/api fail to build because google-protobuf is not listed as a top-level dependency.

How can we reproduce the issue?

Repro: Try to build a project with a dependency on @actual/apiusing yarn 4

Result: Error: @actual-app/api tried to access google-protobuf, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Workaround: add a stanza to .yarnrc.yml with the missing dependency:

packageExtensions:
  "@actual-app/api@*":
    dependencies:
      google-protobuf: "^3.12.0-rc.1"

Where are you hosting Actual?

Locally via Yarn

What browsers are you seeing the problem on?

Chrome, Other

Operating System

Linux

Originally created by @thromer on GitHub (Nov 1, 2025). ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? yarn4 projects that depend on `@actual/api` fail to build because `google-protobuf `is not listed as a top-level dependency. ### How can we reproduce the issue? Repro: Try to build a project with a dependency on `@actual/api`using yarn 4 Result: `Error: @actual-app/api tried to access google-protobuf, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.` Workaround: add a stanza to `.yarnrc.yml` with the missing dependency: ``` packageExtensions: "@actual-app/api@*": dependencies: google-protobuf: "^3.12.0-rc.1" ``` ### Where are you hosting Actual? Locally via Yarn ### What browsers are you seeing the problem on? Chrome, Other ### Operating System Linux
GiteaMirror added the dependenciesbug labels 2026-02-28 20:20:06 -06:00
Author
Owner

@matt-fidd commented on GitHub (Nov 3, 2025):

For some reason it works okay for me with yarn4 I was using node_modules linker

% yarn why google-protobuf -R
└─ my-project@workspace:.
   └─ @actual-app/api@npm:25.11.0-nightly.20251102 (via npm:25.11.0-nightly.20251102)
      └─ @actual-app/crdt@npm:2.1.0 (via npm:^2.1.0)
         └─ google-protobuf@npm:3.21.4 (via npm:^3.12.0-rc.1)
@matt-fidd commented on GitHub (Nov 3, 2025): ~~For some reason it works okay for me with yarn4~~ I was using node_modules linker ``` % yarn why google-protobuf -R └─ my-project@workspace:. └─ @actual-app/api@npm:25.11.0-nightly.20251102 (via npm:25.11.0-nightly.20251102) └─ @actual-app/crdt@npm:2.1.0 (via npm:^2.1.0) └─ google-protobuf@npm:3.21.4 (via npm:^3.12.0-rc.1) ```
Author
Owner

@thromer commented on GitHub (Nov 3, 2025):

Right, apologies for not including explicit repro steps. For posterity:

mkdir /tmp/bar
cd /tmp/bar
yarn init
yarn add @actual-app/api
echo "let api = require('@actual-app/api');" > bar.js
yarn node bar.js

Repeated from my comment on my PR, I'm fine with punting or deferring this; after reporting the issue I realized that currently the way I have Emacs set up as my IDE for TypeScript doesn't handle PnP well either, and my impression is that most folks set nodeLinker: node-modules in .yarnrc.yml and get on with their lives.

@thromer commented on GitHub (Nov 3, 2025): Right, apologies for not including explicit repro steps. For posterity: ``` mkdir /tmp/bar cd /tmp/bar yarn init yarn add @actual-app/api echo "let api = require('@actual-app/api');" > bar.js yarn node bar.js ``` Repeated from my [comment on my PR](https://github.com/actualbudget/actual/pull/6048#discussion_r2484000461), I'm fine with punting or deferring this; after reporting the issue I realized that currently the way I have Emacs set up as my IDE for TypeScript doesn't handle PnP well either, and my impression is that most folks set `nodeLinker: node-modules` in `.yarnrc.yml` and get on with their lives.
Author
Owner

@thromer commented on GitHub (Nov 10, 2025):

Quoting @MatissJanis on the PR

Yeah, I think this one is a wont-fix.

Yarn PnP is not supported by other large projects (famously: TypeScript). So it's not exactly a web standard that should be adopted.

However, I get that it can be somewhat frustrating. I wish there was a way to get the best of both worlds - PnP support without the need to manually hack in dependencies.

@thromer commented on GitHub (Nov 10, 2025): Quoting @MatissJanis on the PR > Yeah, I think this one is a wont-fix. > > Yarn PnP is not supported by other large projects (famously: TypeScript). So it's not exactly a web _standard_ that should be adopted. > > However, I get that it can be somewhat frustrating. I wish there was a way to get the best of both worlds - PnP support without the need to manually hack in dependencies.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#2585