tonhowtf/omniget · warning

[music] playlists load failed

Error message

[music] playlists load failed

What it means

Warning (dev-only, guarded by import.meta.env.DEV) emitted when the playlists store's load() fails to fetch playlists via pluginInvoke('study','study:music:playlists:list'). this.list stays stale/empty and loaded remains false; in production the failure is silent.

Solutions

  1. Await backend/plugin readiness before the first load()
  2. Check the caught error for file-read/permission problems on the playlists store and repair the file
  3. Update frontend and plugin to matching versions
  4. Note the DEV-only warning: in production add your own error surfacing if you need visibility

Example fix

// before
await playlists.load();
// after
await backendReady("study");
await playlists.load();
if (!playlists.loaded) showPlaylistErrorBanner();
Defensive patterns

Strategy: retry

Validate before calling

if (!playlists.loaded && !playlists.loading) await playlists.load();

Type guard

function isPlaylistList(v: unknown): v is { playlists: Playlist[] } { return typeof v === "object" && v !== null && Array.isArray((v as any).playlists); }

Try / catch

try { await playlists.load(); } catch (e) { console.warn("[music] playlists unavailable, using cache", e); this.list = cachedPlaylists ?? []; }

Prevention

When it happens

Trigger: Calling load() (directly or via create/deleteOne/addTrack/removeTrack/reorder/update) when the playlists:list backend command rejects — plugin not initialized, backend error reading the playlists file, or IPC failure.

Common situations: Modifying playlists right after app start before the backend is ready; corrupted or unreadable playlists.json; plugin version mismatch removing the list command.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/713b7630fa5dbbaa. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/study-music/playlists-store.svelte.ts:31

class PlaylistsStore {
  list = $state<Playlist[]>([]);
  loaded = $state(false);
  loading = $state(false);

  async load(force = false) {
    if (this.loaded && !force) return;
    this.loading = true;
    try {
      const res = await pluginInvoke<{ playlists: Playlist[] }>(
        "study",
        "study:music:playlists:list",
      );
      this.list = res.playlists ?? [];
      this.loaded = true;
    } catch (e) {
      if (import.meta.env.DEV) {
        console.warn("[music] playlists load failed", e);
      }
    } finally {
      this.loading = false;
    }
  }

  async create(name: string, description?: string): Promise<number | null> {
    try {
      const res = await pluginInvoke<{ id: number }>(
        "study",
        "study:music:playlists:create",
        { name, description: description ?? null },
      );
      await this.load(true);
      return res.id;
    } catch (e) {
      throw e;
    }

View on GitHub (pinned to 8600b91f42)