laurent22/joplin · error · Error

No recipient found with email ${email}

Error message

No recipient found with email ${email}

What it means

Thrown in `commandShareRemove` when the recipient list was loaded but no entry has a `user.email` matching the supplied email argument. The share exists and has recipients, just none with that exact email address. The email is interpolated so the user can see which address failed.

Source

Thrown at packages/app-cli/app/command-share.ts:108

		const commandShareRemove = async (folder: FolderEntity, email: string) => {
			await ShareService.instance().refreshShares();

			const share = getShareFromFolderId(folder.id);
			if (!share) {
				throw new Error(`No share found for folder ${folder.id}`);
			}

			await ShareService.instance().refreshShareUsers(share.id);

			const shareUsers = getShareUsers(folder.id);
			if (!shareUsers) {
				throw new Error(`No share found for folder ${folder.id}`);
			}

			const targetUser = shareUsers.find(user => user.user?.email === email);
			if (!targetUser) {
				throw new Error(`No recipient found with email ${email}`);
			}

			await ShareService.instance().deleteShareRecipient(targetUser.id);
			this.stdout(_('Removed %s from share.', targetUser.user.email));
		};

		const commandShareList = async () => {
			let folder = null;
			if (args.notebook) {
				folder = await app().loadItemOrFail(ModelType.Folder, args.notebook);
			}

			await ShareService.instance().maintenance();

			if (folder) {
				const share = getShareFromFolderId(folder.id);
				await ShareService.instance().refreshShareUsers(share.id);

View on GitHub (pinned to 2654b33620)

Solutions

  1. Run `share list <notebook>` and copy the exact email shown in the recipient list.
  2. Trim whitespace and verify lowercase/uppercase matches the stored value.
  3. If the recipient is absent from the list, they were already removed — nothing to do.

Example fix

// before
const targetUser = shareUsers.find(user => user.user?.email === email);
if (!targetUser) throw new Error(`No recipient found with email ${email}`);

// after - case-insensitive match and a clearer message listing valid emails
const targetUser = shareUsers.find(u => u.user?.email?.toLowerCase() === email.trim().toLowerCase());
if (!targetUser) throw new Error(`No recipient "${email}" on this share. Recipients: ${shareUsers.map(u => u.user?.email).join(', ')}`);
Defensive patterns

Strategy: validation

Validate before calling

const targetUser = shareUsers.find(u => u.user?.email?.toLowerCase() === email.trim().toLowerCase());
if (!targetUser) {
	throw new Error(`No recipient "${email}" on this share. Recipients: ${shareUsers.map(u => u.user?.email).join(', ')}`);
}

Type guard

const isValidEmail = (v: unknown): v is string => typeof v === 'string' && /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v);

Try / catch

try {
	await commandShareRemove(folder, email);
} catch (e) {
	if (/No recipient found/.test(e.message)) { /* re-list recipients and reprompt */ }
	else throw e;
}

Prevention

When it happens

Trigger: Running `share remove <notebook> <email>` where `<email>` does not case-exactly match any `shareUsers[*].user.email`. Common causes: trailing whitespace, different capitalization, or the recipient was invited under a secondary email.

Common situations: Typo in the email argument; copy-paste introduced whitespace; recipient's account email changed; the recipient was already removed so the list no longer contains them.

Related errors


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