Skip to content

quickstart-chat issues with Claude Code #2540

Description

@capncleaver

Ahoy! Very interesting tool, excited to try it out Claude Code and I tried to install the quickstart-chat app, vanilla.

It was fiddly business, we got there in the end (took ~one instance worth of context.) Here's CC's writeup, I hope this is useful.

In particular I noticed the version depenency was wrong for the rust-client (first attempt, aborted) and I think the quickstart-chat. Given that quickstart-chat is a rust client, the presence of both is confusing but quickstart seems the more recent.

Getting SpacetimeDB Quickstart-Chat Working: The Ideal Path

Here's a summary of the steps needed to get the SpacetimeDB quickstart-chat example working, following the most direct path:

1. Setting up the proper Rust environment

# Install Rust with rustup (not Homebrew) to ensure proper WebAssembly support
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.84.0 --profile default --target wasm32-unknown-unknown

# Add WebAssembly target support
rustup target add wasm32-unknown-unknown

2. Installing and running SpacetimeDB

# Install SpacetimeDB CLI
curl -sSf https://install.spacetimedb.com | sh

# Add SpacetimeDB to PATH
export PATH="$HOME/.local/bin:$PATH"

# Start SpacetimeDB in the background
spacetime start > /tmp/spacetime.log 2>&1 &

3. Publishing the module

# Navigate to the quickstart-chat module directory
cd modules/quickstart-chat

# Build and publish the module
spacetime publish --server http://127.0.0.1:3000 --anonymous chat-demo

4. Building and running the client

# Create a directory for the client
mkdir -p quickstart-chat-client/src

# Copy the module bindings
cp -R modules/quickstart-chat/module_bindings quickstart-chat-client/src/

# Create Cargo.toml with proper dependencies
cat > quickstart-chat-client/Cargo.toml << EOF
[package]
name = "quickstart-chat-client"
version = "0.1.0"
edition = "2021"

[dependencies]
spacetimedb-sdk = "1.0.1"
EOF

# Create main.rs with the client code, using the correct module name
# (Key point: The with_token handling should be optional for first-time users)

# Build and run the client
cd quickstart-chat-client
cargo run

Feedback for SpacetimeDB developers

  1. Rust installation instructions: The documentation should emphasize that rustup (not Homebrew Rust) is required for proper WebAssembly support, with specific instructions for the target.

  2. Client authentication handling: The example should better handle first-time connections without credentials. Currently, it uses .expect() which causes errors for new users.

  3. Module ownership and permissions: We encountered several permission errors when trying to republish or update modules. A clearer ownership model or easier way to manage modules for development would be helpful.

  4. Non-interactive client options: The example could benefit from a non-interactive mode for testing, as interactive terminal input can be challenging in some environments.

  5. Better error messages: When the server isn't running, the client error messages could be more clear about connection issues.

  6. Documentation for common operations: More examples for common tasks like listing databases, checking status, deleting, and updating modules would be helpful.

  7. WebAssembly optimization warnings: The warning about missing wasm-opt is confusing for beginners. Either include it or make the warning less prominent.

  8. Consistent API across language SDKs: Ensure authentication and connection patterns are consistent across different SDKs.

  9. Offline development mode: A simpler local development experience that doesn't require authentication would help developers get started more quickly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions