HarperFast / HarperFast/harper

harper dev does not serve static files when app path contains a dotfile directory

Open
#196 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
89
Forks
10
Avg merge
2d 2h
Merged PRs (30d)
205

Description

### Bug Summary

When running harper dev . from a directory whose path contains a dotfile directory (e.g. .claude), the static extension fails to serve files — all requests return 404. Other extensions (jsResource, fastifyRoutes, graphqlSchema, loadEnv) work correctly from the same path.

### Reproduction Repository (if applicable)

_No response_

### Steps to Reproduce

1. Create a Harper app with a `static` extension in `config.yaml`:
```
static:
files: 'site/**'
urlPath: 'app'
index: true
extensions: ['html']
```
2. Place HTML files in the `site/` directory
3. Run `harper dev .` from a path containing a dotfile directory, e.g.:
`/Users/me/my-app/.hidden-dir/worktrees/my-branch/`
4. Request `http://localhost:9926/app/` → 404
5. Request `http://localhost:9926/HealthCheck` (jsResource) → 200 ✅

### Expected Behavior

Static files are served at `/app/` regardless of the app's directory path.

### Actual Behavior

Static files return 404 when the path includes a dotfile directory. Other extensions load fine.

### Platform

Harper 4.7.20 (also reproduced on 4.7.3 and 4.7.19), Node.js v24.11.0, macOS

### Console Errors

_No response_

### Screenshots or Videos

_No response_

### Additional Context

Workaround: Run `harper dev .` from a path that doesn't contain dotfile directories (e.g. the main repo root rather than a git worktree under a hidden directory).

- File permissions are all standard (755 dirs, 644 files) — not a permissions issue
- `loadEnv` loads correctly from the same path (env conflict warnings confirm Harper finds the right directory)
- Fresh Harper install (removed data directory and reinstalled) — same result
- The same app code works perfectly when deployed to Harper Fabric
- The same app works with `harper dev .` from the main repo path (`/Users/me/my-app/`) which has no dotfile directories
- This was discovered using git worktrees located under `.claude/worktrees/`, a common pattern with Claude Code

### Are you planning to fix this issue?

No, just reporting the issue

### First-time contributor support

- [ ] I'm new to contributing and would appreciate guidance on the process
- [ ] I'd like help understanding the project structure
- [ ] I need assistance with setting up the development environment
- [ ] I'm comfortable contributing, but new to this project specifically

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.