DIYgod/RSSHub · error · InvalidParameterError

软件信息不存在,请报告这个问题

Error message

软件信息不存在,请报告这个问题

What it means

An InvalidParameterError from the Nintendo eShop CN route. After fetching the page and extracting Nuxt data via util.nuxtReader, the handler checks result.recentSoftwareList; if absent it concludes the Nuxt payload did not contain the expected software listing and throws. Despite the 'InvalidParameter' type, the real cause is almost always upstream structure change, not a bad user parameter.

Source

Thrown at lib/routes/nintendo/eshop-cn.ts:46

    // 获取Nuxt对象
    const result = (await util.nuxtReader(response.data)) as Record<string, any>;

    /* expectedReleaseNS[]
        coverImageUrl: "//switch-cn.gtgres.com/global-images/c50e3390-14e5-11ea-9b40-236e671bca9e.png"
        expectedReleaseDate: 0
        expectedReleaseDateFuzzy: ""
        gameName: "Mario Tennis Aces"
        id: 1852
        newsPageUrl: ""
      recentSoftwareList[]
        imgUrl: "https://metadata-images.nintendoswitch.com.cn/formal/8332803007012-1F2B121D-743F-B868-5595-35C79BB2A817-KV.jpg"
        jumpUrl: "https://www.nintendoswitch.com.cn/awuxa/index.html"
        publishTime: "2022.10.31"
        title: "附带导航!一做就上手 第一次的游戏程序设计"
    */
    if (!result.recentSoftwareList) {
        throw new InvalidParameterError('软件信息不存在,请报告这个问题');
    }

    let data = result.recentSoftwareList.map((item) => ({
        title: item.title,
        description: util.generateImageLink(item.imgUrl),
        link: item.jumpUrl.startsWith('http') ? item.jumpUrl : `${software_url}${item.jumpUrl}`,
        pubDate: parseDate(item.publishTime, 'YYYY.MM.DD'),
    }));

    data = await util.ProcessItemChina(data, cache);

    return {
        title: 'Nintendo eShop(国服)新游戏',
        link: 'https://www.nintendoswitch.com.cn/software',
        description: 'Nintendo(国服)新上架的游戏',
        item: data,
    };
}

View on GitHub (pinned to bed535e087)

Solutions

  1. Open the eShop CN URL in a browser and inspect window.__NUXT__ to confirm whether recentSoftwareList still exists and at which data index.
  2. If the key was renamed, update the check and the subsequent map() in the handler.
  3. If the list is genuinely empty (no current software), consider returning an empty feed rather than throwing InvalidParameterError.
  4. Report the structure change to the route maintainers.

Example fix

// before
if (!result.recentSoftwareList) {
    throw new InvalidParameterError('软件信息不存在,请报告这个问题');
}

// after — distinguish missing-key from empty-list
if (!result.recentSoftwareList) {
    throw new Error('eShop CN: recentSoftwareList missing from Nuxt payload (page structure changed)');
}
Defensive patterns

Strategy: try-catch

Type guard

const hasRecentSoftwareList = (r: any): r is { recentSoftwareList: any[] } =>
  !!r && Array.isArray(r.recentSoftwareList);

Try / catch

try {
  const result: any = await util.nuxtReader(response.data);
  if (!result.recentSoftwareList) throw new Error('eShop CN: recentSoftwareList missing — page structure changed');
} catch (e) {
  // either Nuxt extraction failed (409) or the key drifted — report to maintainers
}

Prevention

When it happens

Trigger: The Nuxt payload parses (so nuxtReader did not throw) but the recentSoftwareList key is missing — the page returned a different payload (empty listing, error state, a redesigned data shape), or nuxtReader returned the wrong data index. Also possible during regional outages or when the list is temporarily empty.

Common situations: Nintendo CN restructures the Nuxt payload; the page is in a maintenance/error state that still parses as Nuxt but lacks the software list; nuxtReader picks __NUXT__.data[0] but the relevant data moved to another index.

Related errors


AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12). Data as JSON: /api/errors/85d9a269f302a403. Report an issue: GitHub.