Skip to content

v0.17.3: app crashes on startup — datetime("now") SQLite error in seedBuiltinEntries #67

@wise-toddler

Description

@wise-toddler

Bug

SlayZone v0.17.3 (brew install) crashes on startup with:

[boot] whenReady failed: SqliteError: no such column: "now" - should this be a string literal in single-quotes?
    at seedBuiltinEntries (out/main/index.js:45221:5)
    at registerMarketplaceHandlers (out/main/index.js:44916:3)

Window never appears. Process stays alive but no UI.

Root Cause

Two SQL statements in handlers-marketplace.ts use template literals containing datetime('now'):

// Line 121
db.prepare(\`UPDATE skill_registries SET enabled = ?, updated_at = datetime('now') WHERE id = ?\`)
// Line 456
db.prepare(\`UPDATE ai_config_items SET content = ?, metadata_json = ?, updated_at = datetime('now') WHERE id = ?\`)

esbuild converts simple template literals (no interpolation) to single-quoted strings, flipping inner single quotes to double quotes:

// Compiled output:
db2.prepare('UPDATE skill_registries SET enabled = ?, updated_at = datetime("now") WHERE id = ?')

In SQLite, "now" is a column identifier, not a string literal. There's no column named now, so it crashes.

Other SQL statements in the same file survive because they use multi-line template literals with interpolation, which esbuild preserves as-is.

Fix

Use double-quoted JS strings so the inner single quotes are preserved through the build:

db.prepare("UPDATE ... datetime('now') ...")

Repro

  1. brew install --cask slayzone (v0.17.3)
  2. Open the app
  3. Window never appears
  4. Run from terminal to see the error:
    /Applications/SlayZone.app/Contents/MacOS/SlayZone
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions