laurent22/joplin · error · Error

No note with id ${id}

Error message

No note with id ${id}

What it means

Thrown by the mobile `goToNote` command when `Note.load(id)` returns a falsy value, meaning no note row exists in the database for the supplied id. It is a precondition guard before navigating to the `Note` route via `NavService.go`. The id is interpolated verbatim so the caller sees exactly what was looked up.

Source

Thrown at packages/app-mobile/commands/util/goToNote.ts:16

import Note from '@joplin/lib/models/Note';
import NavService from '@joplin/lib/services/NavService';
import { AttachFileAction } from '../../components/screens/Note/commands/attachFile';

export interface GotoNoteOptions {
	attachFileAction?: AttachFileAction | null;
}

const goToNote = async (id: string, hash?: string, options: GotoNoteOptions = null) => {
	options = {
		attachFileAction: null,
		...options,
	};

	if (!(await Note.load(id))) {
		throw new Error(`No note with id ${id}`);
	}

	return NavService.go('Note', {
		noteId: id,
		noteHash: hash,
		newNoteAttachFileAction: options.attachFileAction,
	});
};

export default goToNote;

View on GitHub (pinned to 2654b33620)

Solutions

  1. Verify the note exists before calling: `const note = await Note.load(id); if (!note) return;`
  2. Ensure the target profile is active if ids come from a different profile context.
  3. If the id originates from a deep link / share intent, validate it is a non-empty string and trigger a sync before navigating.
  4. Wrap the call in try/catch and surface a user-facing 'note not found' message rather than letting the error propagate.

Example fix

// before
goToNote(id);

// after
if (await Note.load(id)) {
  await goToNote(id);
} else {
  logger.warn('Skipping navigation; note does not exist:', id);
}
Defensive patterns

Strategy: validation

Validate before calling

import Note from '@joplin/lib/models/Note';

const noteExists = async (id: string) => !!(await Note.load(id));

if (!(await noteExists(id))) {
  logger.warn('Refusing to navigate: note does not exist', id);
  return;
}
await goToNote(id);

Type guard

const isNoteId = (id: unknown): id is string =>
  typeof id === 'string' && id.length > 0;

Try / catch

try {
  await goToNote(id);
} catch (error) {
  if (/No note with id/.test(error.message)) {
    logger.warn('Stale note reference:', id);
    return;
  }
  throw error;
}

Prevention

When it happens

Trigger: Calling `goToNote(id, hash?, options?)` with an id that is not present in the SQLite notes table (deleted, never existed, belongs to another profile, or sync has not yet created it). `Note.load` returning `null`/`undefined` for a malformed or empty id string.

Common situations: Following a note link from a synced resource before the note has synced down; opening a share/intent with a stale note id from an older backup; cross-profile navigation where the id lives in a different profile's database; the id was passed from an unvalidated deep link.

Related errors


AI-assisted analysis of laurent22/joplin@2654b33620 (2026-08-12). Data as JSON: /api/errors/42f4d9f15014d346. Report an issue: GitHub.