Repository navigation
[Bug] Invalid String Length #460
Copy link
Copy link
Closed
Description
Activity
Also getting this error in Warp and iTerm2
WARN Fetching latest model pricing from LiteLLM... ccusage 5:40:40 PM ℹ Loaded pricing for 1492 models ccusage 5:40:40 PM np node:internal/fs/promises:586 result += decoder.write(readBuffer); ^ RangeError: Invalid string length at readFileHandle (node:internal/fs/promises:586:25) at async loadDailyUsageData (file:///Users/prb/Library/Application%20Support/fnm/node-versions/v23.11.1/installation/lib/node_modules/ccusage/dist/data-loader-Plh5X-UR.js:2509:20) at async Object.run (file:///Users/prb/Library/Application%20Support/fnm/node-versions/v23.11.1/installation/lib/node_modules/ccusage/dist/index.js:3300:21) at async executeCommand (file:///Users/prb/Library/Application%20Support/fnm/node-versions/v23.11.1/installation/lib/node_modules/ccusage/dist/index.js:758:2) at async cli (file:///Users/prb/Library/Application%20Support/fnm/node-versions/v23.11.1/installation/lib/node_modules/ccusage/dist/index.js:679:2) at async file:///Users/prb/Library/Application%20Support/fnm/node-versions/v23.11.1/installation/lib/node_modules/ccusage/dist/index.js:4438:1 Node.js v23.11.1Env:
- ccusage 16.2.4
- claude v1.0.111
Reacted by jsell-rhnpx [email protected] WARN Fetching latest model pricing from LiteLLM... ccusage 9:51:42 AM ℹ Loaded pricing for 1667 models ccusage 9:51:42 AM node:internal/fs/promises:585 result += decoder.write(readBuffer); ^ RangeError: Invalid string length at readFileHandle (node:internal/fs/promises:585:25) at async loadDailyUsageData (file:///home/jsell/.npm/_npx/86ddde3d5ecc57c4/node_modules/ccusage/dist/data-loader-BGg_9orY.js:3557:19) at async Object.run (file:///home/jsell/.npm/_npx/86ddde3d5ecc57c4/node_modules/ccusage/dist/index.js:4506:21) at async executeCommand (file:///home/jsell/.npm/_npx/86ddde3d5ecc57c4/node_modules/ccusage/dist/index.js:881:2) at async cli (file:///home/jsell/.npm/_npx/86ddde3d5ecc57c4/node_modules/ccusage/dist/index.js:794:2) at async run (file:///home/jsell/.npm/_npx/86ddde3d5ecc57c4/node_modules/ccusage/dist/index.js:6391:2) at async file:///home/jsell/.npm/_npx/86ddde3d5ecc57c4/node_modules/ccusage/dist/index.js:6399:1 Node.js v22.16.0
Same issue on v17.1.3. I have a session file that is 585MB causing this error.
Would love to see this fixed as large projects like this are most critical to keep tabs on costs.
Reacted by Minhu Wang
Metadata
Metadata
Assignees
Labels
No labels
Version. 15.9.1
MacOSX: Sequoia 15.6
Warp Terminal
Brand new installation never been ran. Installed via npm. Running
ccusagereturns the error.