[PR #7202] [MERGED] [AI] Fix navigator is not defined error in @actual-app/api for Node.js environments #32930

Closed
opened 2026-04-18 08:53:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7202
Author: @MatissJanis
Created: 3/14/2026
Status: Merged
Merged: 3/15/2026
Merged by: @MatissJanis

Base: masterHead: claude/fix-issue-7201-zyqBu


📝 Commits (2)

  • 151ab21 [AI] Fix navigator is not defined error in @actual-app/api for Node.js environments
  • 1937efd Add release notes for PR #7202

📊 Changes

3 files changed (+17 additions, -1 deletions)

View changed files

📝 packages/loot-core/src/shared/environment.ts (+4 -1)
packages/loot-core/src/shared/platform.api.ts (+7 -0)
upcoming-release-notes/7202.md (+6 -0)

📄 Description

Add platform.api.ts to provide Node.js-safe defaults for platform detection,
which the API's Vite config resolves before the browser-only platform.ts.
Also guard navigator access in environment.ts isElectron() function.

Fixes #7201

https://claude.ai/code/session_015Xz2nHC12pNkADGjGZnSXd


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 14.94 MB → 14.94 MB (+36 B) +0.00%
loot-core 1 5.76 MB 0%
api 3 4.7 MB → 4.63 MB (-73.41 kB) -1.53%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.94 MB → 14.94 MB (+36 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/shared/environment.ts 📈 +36 B (+9.63%) 374 B → 410 B
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 9.8 MB → 9.8 MB (+36 B) +0.00%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/ca.js 187.85 kB 0%
static/js/da.js 106.13 kB 0%
static/js/de.js 179.82 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 171.21 kB 0%
static/js/es.js 174.29 kB 0%
static/js/fr.js 179.34 kB 0%
static/js/it.js 170.91 kB 0%
static/js/nb-NO.js 156.74 kB 0%
static/js/nl.js 113.03 kB 0%
static/js/pl.js 89.61 kB 0%
static/js/pt-BR.js 182.82 kB 0%
static/js/th.js 181.54 kB 0%
static/js/uk.js 215.25 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/ReportRouter.js 1.16 MB 0%
static/js/narrow.js 423.11 kB 0%
static/js/TransactionList.js 106.52 kB 0%
static/js/wide.js 164.37 kB 0%
static/js/AppliedFilters.js 9.99 kB 0%
static/js/usePayeeRuleCounts.js 11.57 kB 0%
static/js/useTransactionBatchActions.js 13.24 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.76 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.DLyaij02.js 5.76 MB 0%

api

Total

Files count Total bundle size % Changed
3 4.7 MB → 4.63 MB (-73.41 kB) -1.53%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/shared/platform.api.ts 🆕 +52 B 0 B → 52 B
home/runner/work/actual/actual/packages/loot-core/src/server/sheet.ts 📈 +499 B (+10.54%) 4.62 kB → 5.11 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budgetfiles/app.ts 📈 +32 B (+0.28%) 11.22 kB → 11.25 kB
home/runner/work/actual/actual/packages/loot-core/src/mocks/random.ts 📉 -219 B (-89.02%) 246 B → 27 B
node_modules/ua-parser-js/src/main/ua-parser.mjs 🔥 -73.46 kB (-100%) 73.46 kB → 0 B
home/runner/work/actual/actual/packages/loot-core/src/shared/platform.ts 🔥 -311 B (-100%) 311 B → 0 B
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller

Asset File Size % Changed
index.js 4.41 MB → 4.34 MB (-73.41 kB) -1.63%

Unchanged

Asset File Size % Changed
index-BKGP2w5F.js 285.56 kB 0%
multipart-parser-DwddZ4BH.js 9.33 kB 0%

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/7202 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 3/14/2026 **Status:** ✅ Merged **Merged:** 3/15/2026 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `claude/fix-issue-7201-zyqBu` --- ### 📝 Commits (2) - [`151ab21`](https://github.com/actualbudget/actual/commit/151ab211a2cc97f7fa462b1c3eaab45a744ff026) [AI] Fix navigator is not defined error in @actual-app/api for Node.js environments - [`1937efd`](https://github.com/actualbudget/actual/commit/1937efd729d7685ca54bc2400b4ae10b69af707d) Add release notes for PR #7202 ### 📊 Changes **3 files changed** (+17 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/shared/environment.ts` (+4 -1) ➕ `packages/loot-core/src/shared/platform.api.ts` (+7 -0) ➕ `upcoming-release-notes/7202.md` (+6 -0) </details> ### 📄 Description Add platform.api.ts to provide Node.js-safe defaults for platform detection, which the API's Vite config resolves before the browser-only platform.ts. Also guard navigator access in environment.ts isElectron() function. Fixes #7201 https://claude.ai/code/session_015Xz2nHC12pNkADGjGZnSXd <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 14.94 MB → 14.94 MB (+36 B) | +0.00% loot-core | 1 | 5.76 MB | 0% api | 3 | 4.7 MB → 4.63 MB (-73.41 kB) | -1.53% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 14.94 MB → 14.94 MB (+36 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/shared/environment.ts` | 📈 +36 B (+9.63%) | 374 B → 410 B </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.8 MB → 9.8 MB (+36 B) | +0.00% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/ca.js | 187.85 kB | 0% static/js/da.js | 106.13 kB | 0% static/js/de.js | 179.82 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 171.21 kB | 0% static/js/es.js | 174.29 kB | 0% static/js/fr.js | 179.34 kB | 0% static/js/it.js | 170.91 kB | 0% static/js/nb-NO.js | 156.74 kB | 0% static/js/nl.js | 113.03 kB | 0% static/js/pl.js | 89.61 kB | 0% static/js/pt-BR.js | 182.82 kB | 0% static/js/th.js | 181.54 kB | 0% static/js/uk.js | 215.25 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/ReportRouter.js | 1.16 MB | 0% static/js/narrow.js | 423.11 kB | 0% static/js/TransactionList.js | 106.52 kB | 0% static/js/wide.js | 164.37 kB | 0% static/js/AppliedFilters.js | 9.99 kB | 0% static/js/usePayeeRuleCounts.js | 11.57 kB | 0% static/js/useTransactionBatchActions.js | 13.24 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.76 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.DLyaij02.js | 5.76 MB | 0% </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 3 | 4.7 MB → 4.63 MB (-73.41 kB) | -1.53% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/shared/platform.api.ts` | 🆕 +52 B | 0 B → 52 B `home/runner/work/actual/actual/packages/loot-core/src/server/sheet.ts` | 📈 +499 B (+10.54%) | 4.62 kB → 5.11 kB `home/runner/work/actual/actual/packages/loot-core/src/server/budgetfiles/app.ts` | 📈 +32 B (+0.28%) | 11.22 kB → 11.25 kB `home/runner/work/actual/actual/packages/loot-core/src/mocks/random.ts` | 📉 -219 B (-89.02%) | 246 B → 27 B `node_modules/ua-parser-js/src/main/ua-parser.mjs` | 🔥 -73.46 kB (-100%) | 73.46 kB → 0 B `home/runner/work/actual/actual/packages/loot-core/src/shared/platform.ts` | 🔥 -311 B (-100%) | 311 B → 0 B </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** Asset | File Size | % Changed ----- | --------- | --------- index.js | 4.41 MB → 4.34 MB (-73.41 kB) | -1.63% **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- index-BKGP2w5F.js | 285.56 kB | 0% multipart-parser-DwddZ4BH.js | 9.33 kB | 0% </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-18 08:53:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#32930