Skip to content

spacetime dev: --module-path / config module-path ignored by file watcher #4443

@redrockvp

Description

@redrockvp

Description

spacetime dev accepts a --module-path CLI flag and a "module-path" key in spacetime.json, but the file watcher ignores both and always watches <project-path>/spacetimedb/ regardless.

This makes spacetime dev unusable for projects where the server module and client are in separate repositories/directories (e.g., a meta-repo with git submodules).

Steps to Reproduce

  1. Have a project structure where server and client are in separate directories:

    project/
      repos/server/       # Rust SpacetimeDB module
      repos/client/       # TypeScript client
    
  2. Create spacetime.json in the client directory:

    {
      "server": "local",
      "module-path": "D:/Projects/my-project/repos/server",
      "module-bindings-path": "src/module_bindings"
    }
  3. Run from the client directory:

    spacetime dev my-database --server-only -y

Expected Behavior

File watcher should watch the path specified in module-path:

Watching for changes in: D:\Projects\my-project\repos\server

Actual Behavior

File watcher ignores module-path and defaults to <project-path>/spacetimedb/:

Starting development mode...
Database: my-database
Watching for changes in: D:\Projects\my-project\repos\client\.\spacetimedb
Press Ctrl+C to stop

Building...
Error: Failed to build project

Caused by:
    Could not detect the language of the module. Are you in a SpacetimeDB project directory?

Same behavior occurs with --module-path as a CLI flag — the flag is accepted but the watcher still uses the default path.

Environment

  • SpacetimeDB CLI: 2.0.1
  • OS: Windows 11
  • Project layout: Git submodules with separate server/client repos

Related Issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions