brainy/archive/fix-documentation.md
David Snelling 79df44351c **chore: remove outdated changelog and summary documents**
- Deleted `CHANGES.md`, `CHANGES_SUMMARY.md`, `CONCURRENCY_ANALYSIS.md`, `CONCURRENCY_IMPLEMENTATION_SUMMARY.md`, and related developer documentation files.
- Removed redundant or legacy content no longer aligned with the current codebase and workflows.
- Updated repository to reflect streamlined documentation approach, reducing clutter and improving maintainability.

**Purpose**: Simplify and declutter repository by removing obsolete documentation files, ensuring it remains focused and relevant.
2025-07-30 11:51:39 -07:00

34 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Fix for "process.memoryUsage is not a function" Error
## Issue
During test runs with Vitest, the following error was occurring:
```
TypeError: process.memoryUsage is not a function
VitestTestRunner.onAfterRunSuite node_modules/vitest/dist/runners.js:150:95
```
This error was happening because Vitest was trying to use `process.memoryUsage()` to log heap usage statistics, but this function was not available in the current environment.
## Solution
The issue was fixed by disabling the heap usage logging in the Vitest configuration:
In `vitest.config.ts`, changed:
```typescript
// Show test statistics
logHeapUsage: true,
```
To:
```typescript
// Show test statistics
logHeapUsage: false,
```
## Explanation
The `logHeapUsage` option in Vitest attempts to use Node.js's `process.memoryUsage()` function to track and report memory usage during test runs. However, this function might not be available in all environments, particularly in certain browser-like environments or when using specific Node.js versions or configurations.
By setting `logHeapUsage: false`, we prevent Vitest from attempting to call this function, which resolves the error while still allowing tests to run successfully.
## Verification
After making this change, the tests run without any unhandled errors, confirming that the issue has been resolved.