Skip to content

[Bug]: Localflare fails to start when project directory contains spaces in path #46

Description

@himanshu-ntml

Describe the bug

Localflare fails when the app directory contains spaces in its name.

In my case:
~/Desktop/Example App

Running:
localflare attach
did not work and produced path-related errors.

After renaming the folder to remove the space:
~/Desktop/ExampleApp
the same command worked immediately:
localflare attach

This confirms the issue is caused by improper handling of directory paths containing spaces. Localflare appears to pass the working directory to underlying processes without quoting/escaping it.

Localflare should support spaces in project/app directory names, or properly escape the path before executing commands.

Steps to reproduce

Steps to Reproduce

# Go to Desktop
cd ~/Desktop && \

# Create an app folder with a space in the name
mkdir "Example App" && \
cd "Example App" && \

# Initialize any project (placeholder)
npm init -y && \

# Run Localflare attach (expected to fail)
localflare attach; \

# Rename the folder to remove the space
cd ~/Desktop && \
mv "Example App" ExampleApp && \
cd ExampleApp && \

# Run the same command again (expected to work)
localflare attach


### Expected behavior

## Expected Behavior

Localflare should start and attach successfully even when the project directory contains spaces in its name.

Running commands like:

```bash
localflare attach
from a directory such as:

~/Desktop/Example App
should work the same as running them from:

~/Desktop/ExampleApp
Paths containing spaces should be properly handled, quoted, or escaped internally by Localflare so that startup and attach commands do not fail.



### Actual behavior

## Actual Behavior

Localflare fails to start/attach when the project directory contains spaces in its name.

Running:

```bash
localflare attach

### Which binding type is affected?

Not applicable / Other

### Localflare version

localflare/0.2.0 darwin-arm64 node-v22.11.0

### Node.js version

v22.11.0

### Wrangler version

wrangler 4.63.0

### Operating System

macOS

### Browser (for dashboard issues)

Not applicable

### Localflare mode

Attach mode (localflare attach)

### Relevant wrangler.toml configuration

```toml
{
    "$schema": "node_modules/wrangler/config-schema.json",
    "name": "queue-example",
    "main": "src/index.ts",
    "compatibility_date": "2024-01-01",
    // Queue producer binding - use this to send messages
    "queues": {
        "producers": [
            {
                "binding": "MY_QUEUE",
                "queue": "my-queue"
            }
        ],
        "consumers": [
            {
                "queue": "my-queue",
                "max_batch_size": 1,
                "max_batch_timeout": 1
            }
        ]
    }
}

Console output / Error logs

Additional context

No response

Pre-submission checklist

  • I have searched existing issues to avoid duplicates
  • I have tested with the latest version of Localflare
  • I have included all required information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions