IntersectMBO / IntersectMBO/govtool

TypeError: Cannot read properties of undefined (reading 'yes_votes')

Open
#3,306 3 comments 0 reactions 1 assignee Claimed by @profd2004 View on GitHub
🐛 Bug 🕵️‍♂️ Testing Sentry
Dominant language
HTML
Stars
21
Forks
29
Avg merge
2d 22h
Merged PRs (30d)
7

Description

Sentry Issue: [GOVTOOL-FRONTEND-JS](https://intersect.sentry.io/issues/6488123461/?referrer=github_integration)

```
TypeError: Cannot read properties of undefined (reading 'yes_votes')
at Tu (/assets/index-DunOmkto.js:1:392800)
at ho (/assets/index-vh7wGAbc.js:20:60115)
at yc (/assets/index-vh7wGAbc.js:20:118968)
at gl (/assets/index-vh7wGAbc.js:20:108220)
at hl (/assets/index-vh7wGAbc.js:20:108148)
...
(5 additional frame(s) were not displayed)
```

### Context
When a valid governance action ID is provided, the outcomes details page successfully loads:
👉 [Example Valid URL](https://preview.gov.tools/outcomes/governance_actions/8d658da00803e3bddb49a0b85be24705bdea4317526b56ab651e5881b1cfc45f#0).

However, if an invalid or non-existent governance action ID is used, the page displays a blank screen and logs the error:
`TypeError: Cannot read properties of undefined (reading 'yes_votes')`

### Steps to Reproduce
1. Navigate to: [Invalid Governance Action ID](https://gov.tools/outcomes/governance_actions/56f39054758f1a3cedc1de9225d66bf270b62dfdbfbc5399f1d6d43aceffc63) (or any invalid governance action ID).

### Actual Behavior
- The page renders as a blank screen.
- The console logs the error: `Cannot read properties of undefined (reading 'yes_votes')`.

![Image](https://github.com/user-attachments/assets/b7fb9906-5259-4207-80b4-78aad005061f)

### Expected Behavior
- If the governance action ID is invalid or not found, the application should handle the response gracefully.
- Instead of a blank screen, display a message such as **"Governance action ID not found."**

![Image](https://github.com/user-attachments/assets/523e27ad-217a-4d5c-9ec7-97dd617eb30c)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.