Skip to content

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

@hdbjeff

Description

@hdbjeff

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']
  1. Place HTML files in the site/ directory
  2. Run harper dev . from a path containing a dotfile directory, e.g.:
    /Users/me/my-app/.hidden-dir/worktrees/my-branch/
  3. Request http://localhost:9926/app/ → 404
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions