Skip to content

spacetime dev - Improve error when module directory does not exist#4467

Merged
clockwork-labs-bot merged 3 commits intomasterfrom
bot/dev-missing-dir-error
Feb 26, 2026
Merged

spacetime dev - Improve error when module directory does not exist#4467
clockwork-labs-bot merged 3 commits intomasterfrom
bot/dev-missing-dir-error

Conversation

@clockwork-labs-bot
Copy link
Collaborator

When spacetime dev (or publish) cannot find the module directory, the error was:

Error: Failed to build project
Could not detect the language of the module. Are you in a SpacetimeDB project directory?

This is confusing because the real problem is the directory does not exist, not that the language cannot be detected.

Now shows:

Module directory does not exist: '/path/to/missing/dir'.
Check your --module-path flag or the module-path setting in spacetime.json.

Related to #4443.

When spacetime dev (or publish) can't find the module directory, the error was:
  Could not detect the language of the module. Are you in a SpacetimeDB project directory?

Now shows the actual path that's missing:
  Module directory does not exist: '<path>'. Check your --module-path flag or
  the module-path setting in spacetime.json.
bfops
bfops previously approved these changes Feb 26, 2026
Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me:

➜ spacetime dev --server local zeke-test
✓ Using configuration from /home/work/zeke-test/./spacetime.json, /home/work/zeke-test/./spacetime.local.json

Starting development mode...
Database: zeke-test
Watching for changes in: /home/work/zeke-test/././spacetimedb-missing
Client command: cargo run
Press Ctrl+C to stop

Building...
Error: Failed to build project

Caused by:
    Module directory does not exist: '/home/work/zeke-test/././spacetimedb-missing'. Check your --module-path flag or the module-path setting in spacetime.json.

@bfops bfops changed the title Improve error when module directory does not exist spacetime dev - Improve error when module directory does not exist Feb 26, 2026
@clockwork-labs-bot clockwork-labs-bot added this pull request to the merge queue Feb 26, 2026
@bfops bfops removed this pull request from the merge queue due to a manual request Feb 26, 2026
@bfops bfops dismissed their stale review February 26, 2026 03:25

dismissing my review because I'm waiting for another approval and I don't want the bot merging this prematurely

Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, working:

boppy@geralt:~/clockwork/tmp/my-spacetime-app$ spacetime publish --module-path ./dir
Using configuration from /home/boppy/clockwork/tmp/my-spacetime-app/spacetime.json
Using configuration from /home/boppy/clockwork/tmp/my-spacetime-app/spacetime.local.json
Publishing module dir to database 'my-spacetime-app-ebp67'
Error: Project path does not exist: dir
boppy@geralt:~/clockwork/tmp/my-spacetime-app$ spacetime dev
✓ Using configuration from /home/boppy/clockwork/tmp/my-spacetime-app/./spacetime.json, /home/boppy/clockwork/tmp/my-spacetime-app/./spacetime.local.json

Starting development mode...
Database: my-spacetime-app-ebp67
Watching for changes in: /home/boppy/clockwork/tmp/my-spacetime-app/././spacetimedb2
Client command: pnpm run dev
Press Ctrl+C to stop

Building...
Error: Failed to build project

Caused by:
    Module directory does not exist: '/home/boppy/clockwork/tmp/my-spacetime-app/././spacetimedb2'. Check your --module-path flag or the module-path setting in spacetime.json.

Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this looks like a good change.

NIT: possibly rename path_to_project to path_to_module

@clockwork-labs-bot clockwork-labs-bot added this pull request to the merge queue Feb 26, 2026
Merged via the queue into master with commit ebea9a4 Feb 26, 2026
54 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants