fix: Handle missing Claude projects directory and Node.js compatibility issues

- Add proper error handling for missing ~/.claude/projects directory
- Fix TypeError when d.parentPath is undefined (Node.js compatibility)
- Replace toSorted() with sort() for Node.js 18 compatibility
- Handle readdir errors gracefully and return empty arrays

These changes prevent the application from crashing with 'Internal Server Error'
when the Claude projects directory doesn't exist or when using Node.js < 20.
This commit is contained in:
kouyaman345
2025-09-07 07:17:36 +09:00
parent ec0225612c
commit 42d028b06d
6 changed files with 9419 additions and 46 deletions

View File

@@ -6,7 +6,7 @@ if [ -d "dist/.next" ]; then
rm -rf dist/.next
fi
pnpm exec next build
npx next build
cp -r public .next/standalone/
cp -r .next/static .next/standalone/.next/