{"record":{"id":"b63b75406695c311","repo":"remix-run/remix","slug":"nameless-wildcard","errorCode":null,"errorMessage":"nameless-wildcard","messagePattern":"nameless-wildcard","errorType":"validation","errorClass":"CreateHrefError","httpStatus":null,"severity":"error","filePath":"packages/route-pattern/src/lib/href.ts","lineNumber":191,"sourceCode":"      continue\n    }\n    if (token.type === '(') {\n      stack.push({ begin: i, href: '' })\n      i += 1\n      continue\n    }\n    if (token.type === ')') {\n      let frame = stack.pop()!\n      stack[stack.length - 1].href += frame.href\n      i += 1\n      continue\n    }\n    if (token.type === ':' || token.type === '*') {\n      let value = params[token.name]\n      if (value == null) {\n        if (stack.length <= 1) {\n          if (token.name === '*') {\n            throw new CreateHrefError({ type: 'nameless-wildcard', pattern })\n          }\n          if (!missingParams.includes(token.name)) missingParams.push(token.name)\n          i += 1\n          continue\n        }\n        let frame = stack.pop()!\n        i = part.optionals.get(frame.begin!)! + 1\n        if (\n          stack[stack.length - 1].href.endsWith(separator) &&\n          part.tokens[i]?.type === 'separator'\n        ) {\n          i += 1\n        }\n        continue\n      }\n      // oxfmt-ignore\n      stack[stack.length - 1].href +=\n        part.type === 'pathname' && token.type === ':' ? encodePathnameVariableParam(pattern, token.name, value) :","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/route-pattern/src/lib/href.ts#L173-L209","documentation":"While serializing a pattern part, an unnamed splat/wildcard token (`*`) had no matching param value. Because the wildcard is nameless it cannot be silently skipped like a named optional param — emitting nothing would change the shape ambiguously — so href construction fails with a nameless-wildcard error.","triggerScenarios":"Calling href/pathname building on a pattern containing a bare `*` token (e.g. `files/*`) without supplying a value under the key '*' (params['*']), when that token is not inside an optional segment that could absorb the omission.","commonSituations":"Copying pattern syntax from a router that uses bare `*` for catch-alls and forgetting params: { '*': 'rest' }; refactoring from named splats to bare ones; omitting catch-all params when deep-linking programmatically.","solutions":["Pass the wildcard value: href(pattern, { '*': 'some/path' })","Or use a named splat in the pattern (`files/*rest`) and pass `rest`","If the wildcard is optional in practice, wrap it in parentheses so it can be skipped"],"exampleFix":"// before\nhref(parseRoutePattern('/files/*'), {})\n\n// after\nhref(parseRoutePattern('/files/*'), { '*': 'a/b.txt' })","handlingStrategy":"validation","validationCode":"let pattern = parseRoutePattern(source)\nlet needsSplat = pattern.pathname.tokens.some(t => t.type === '*')\nif (needsSplat && params['*'] == null) params = { ...params, '*': '' } // or skip link","typeGuard":"null","tryCatchPattern":"try { href(pattern, params) } catch (e) { if (e?.type === 'nameless-wildcard') { /* supply '*' param */ } }","preventionTips":["Prefer named splats (*rest) over bare *","Always include '*' in param objects for catch-all patterns"],"tags":["route-pattern","href","wildcard","params"],"backgroundTag":"missing-route-params","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}