[Bug]: Rules page throws fatal exception TypeError: n[t] is undefined #154

Closed
opened 2026-02-28 18:50:25 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @winklevos on GitHub (Jan 13, 2023).

Verified issue does not already exist?

I have searched and found no existing issue

What happened?

Confirmed this occurring in the latest docker image v23.1.12 and in local build off master.

On loading /rules page actual may fatally die

image

Reproduce

  1. Go directly to the /rules page. Do not go to another page first

Reproduce non-error then error

  1. Go to payees page
  2. Go to rules page (should load)
  3. F5 refresh (should throw)

What error did you receive?

TypeError: byId[payeeId] is undefined
describe
C:/Users/Nicholas/repos/actual/packages/desktop-client/src/components/ManageRules.js:240

  237 |   let payeeId = s._payee;
  238 |   console.warn(payeeId);
  239 |   console.log(byId);
> 240 |   return payeeId
      | ^  241 |     ? `${byId[payeeId].name} (${s.next_date})`
  242 |     : `Next: ${s.next_date}`;
  243 | }}

TypeError: n[t] is undefined for packaged

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Firefox, Microsoft Edge

Operating System

Windows 11

Originally created by @winklevos on GitHub (Jan 13, 2023). ### Verified issue does not already exist? I have searched and found no existing issue ### What happened? Confirmed this occurring in the latest docker image v23.1.12 and in local build off master. On loading /rules page actual may fatally die ![image](https://user-images.githubusercontent.com/30995408/212278791-eacba332-dd81-4e09-9f5f-7003bd80c1ff.png) Reproduce 1. Go directly to the /rules page. Do not go to another page first Reproduce non-error then error 1. Go to payees page 2. Go to rules page (should load) 3. F5 refresh (should throw) ### What error did you receive? ``` TypeError: byId[payeeId] is undefined describe C:/Users/Nicholas/repos/actual/packages/desktop-client/src/components/ManageRules.js:240 237 | let payeeId = s._payee; 238 | console.warn(payeeId); 239 | console.log(byId); > 240 | return payeeId | ^ 241 | ? `${byId[payeeId].name} (${s.next_date})` 242 | : `Next: ${s.next_date}`; 243 | }} ``` `TypeError: n[t] is undefined` for packaged ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Firefox, Microsoft Edge ### Operating System Windows 11
GiteaMirror added the bug label 2026-02-28 18:50:25 -06:00
Author
Owner

@winklevos commented on GitHub (Jan 13, 2023):

Cause seems to be in packages\desktop-client\src\components\ManageRules.js related to a feature which shows the next scheduled date in the rules, (i've never seen this function)

function ScheduleValue({ value }) {
  let payees = useSelector(state => state.queries.payees);
  console.log(payees);
  let byId = getPayeesById(payees);
  let { data: schedules } = SchedulesQuery.useQuery();

  return (
    <Value
      value={value}
      field="rule"
      data={schedules}
      describe={s => {
        let payeeId = s._payee;
        console.warn(payeeId);
        console.log(byId);
        return payeeId
          ? `${byId[payeeId].name} (${s.next_date})`
          : `Next: ${s.next_date}`;
      }}
    />
  );
}
@winklevos commented on GitHub (Jan 13, 2023): Cause seems to be in `packages\desktop-client\src\components\ManageRules.js` related to a feature which shows the next scheduled date in the rules, (i've never seen this function) ``` js function ScheduleValue({ value }) { let payees = useSelector(state => state.queries.payees); console.log(payees); let byId = getPayeesById(payees); let { data: schedules } = SchedulesQuery.useQuery(); return ( <Value value={value} field="rule" data={schedules} describe={s => { let payeeId = s._payee; console.warn(payeeId); console.log(byId); return payeeId ? `${byId[payeeId].name} (${s.next_date})` : `Next: ${s.next_date}`; }} /> ); } ```
Author
Owner

@shall0pass commented on GitHub (Jan 13, 2023):

The error on the rules page I see is a little different. I'm attaching the log out of the console because it's rather long for a screenshot.
localhost-1673636506473.log

@shall0pass commented on GitHub (Jan 13, 2023): The error on the rules page I see is a little different. I'm attaching the log out of the console because it's rather long for a screenshot. [localhost-1673636506473.log](https://github.com/actualbudget/actual/files/10414633/localhost-1673636506473.log)
Author
Owner

@MatissJanis commented on GitHub (Jan 13, 2023):

The error on the rules page I see is a little different. I'm attaching the log out of the console because it's rather long for a screenshot. localhost-1673636506473.log

That's the same thing. It's quite a verbose error, so here's the part that we're really interested in:

ManageRules.js:237 Uncaught TypeError: Cannot read properties of undefined (reading 'name')
    at describe (ManageRules.js:237:1)
    at formatValue (ManageRules.js:110:1)
    at Value (ManageRules.js:190:1)
    at renderWithHooks (react-dom.development.js:14796:1)
@MatissJanis commented on GitHub (Jan 13, 2023): > The error on the rules page I see is a little different. I'm attaching the log out of the console because it's rather long for a screenshot. [localhost-1673636506473.log](https://github.com/actualbudget/actual/files/10414633/localhost-1673636506473.log) That's the same thing. It's quite a verbose error, so here's the part that we're really interested in: ``` ManageRules.js:237 Uncaught TypeError: Cannot read properties of undefined (reading 'name') at describe (ManageRules.js:237:1) at formatValue (ManageRules.js:110:1) at Value (ManageRules.js:190:1) at renderWithHooks (react-dom.development.js:14796:1) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#154