DIYgod/RSSHub · error · Error
${type} ${slug} not found
Error message
${type} ${slug} not found What it means
Thrown by iplaysoft's `fetchTaxonomy` when the WordPress REST API (`/wp-json/wp/v2/categories?slug=...` or `.../tags?slug=...`) returns no usable taxonomy: the first element is missing, or lacks `id`/`name`. Means the requested category or tag slug does not exist on www.iplaysoft.com (a WordPress site).
Source
Thrown at lib/routes/iplaysoft/utils.ts:11
import cache from '@/utils/cache';
import ofetch from '@/utils/ofetch';
const rootUrl = 'https://www.iplaysoft.com/';
const fetchTaxonomy = async (slug: string, type: 'categories' | 'tags') => {
const taxonomyUrl = `${rootUrl}wp-json/wp/v2/${type}?slug=${slug}`;
const cachedTaxonomy = await cache.tryGet(taxonomyUrl, async () => {
const taxonomyData = await ofetch(taxonomyUrl);
if (!taxonomyData[0] || !taxonomyData[0].id || !taxonomyData[0].name) {
throw new Error(`${type} ${slug} not found`);
}
return { id: taxonomyData[0].id, name: taxonomyData[0].name };
});
return cachedTaxonomy;
};
const fetchCategory = async (categorySlug: string) => await fetchTaxonomy(categorySlug, 'categories');
const fetchTag = async (tagSlug: string) => await fetchTaxonomy(tagSlug, 'tags');
async function fetchNewsItems(apiUrl: string) {
const data = await ofetch(apiUrl);
return data.map((item) => ({
title: item.title.rendered,
description: item.content.rendered,
link: item.link,
pubDate: new Date(item.date_gmt).toUTCString(),
author: item._embedded.author[0].name,View on GitHub (pinned to bed535e087)
Solutions
- Verify the slug by visiting `https://www.iplaysoft.com/wp-json/wp/v2/categories?slug=<slug>` (or `.../tags?...`) and confirm a non-empty array with an `id`.
- Use the slug exactly as it appears in the site's URL (e.g. `/category/pifubao/` -> slug `pifubao`).
- If the taxonomy was renamed, find the new slug from the site's category listing page.
Example fix
// before: GET /iplaysoft/category/typo-slug -> [] // after: confirm slug via the WP API, then use the real one GET /iplaysoft/category/pifubao
Defensive patterns
Strategy: validation
Validate before calling
const r = await ofetch(taxonomyUrl);
if (!Array.isArray(r) || !r[0]?.id || !r[0]?.name) {
throw new InvalidParameterError(`iplaysoft: ${type} slug '${slug}' not found`);
} Type guard
const isTaxonomy = (x: any): x is {id:number;name:string} =>
x && typeof x.id === 'number' && typeof x.name === 'string'; Prevention
- Validate the slug against the WP REST API before caching.
- Use URL slugs (lowercase-hyphen), not display names.
- Cache the taxonomy lookup (it already does) to avoid repeated probes.
When it happens
Trigger: User requests `/iplaysoft/category/:slug` or `/iplaysoft/tag/:slug` with a slug that does not correspond to any real WP category/tag; the WP API returns an empty array `[]` or an object without `id`/`name`.
Common situations: Typo in the slug; slug is the display name instead of the URL slug (WP slugs are lowercase-hyphenated); the category/tag was renamed or deleted; the site restructured taxonomy.
Related errors
- Category not found
- Tag not found
- Invalid category: ${categoryParam}. Valid categories are: ${
- Invalid category
- At least one valid search parameter is required
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/64f9a791f5810400.
Report an issue: GitHub.