{"record":{"id":"9497a1924fa28ca6","repo":"emberjs/ember.js","slug":"you-didn-t-provide-enough-string-numeric-parameter","errorCode":null,"errorMessage":"You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route ${name}. Missing params: ${missingParams}","messagePattern":"You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route (.+?)\\. Missing params: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/router_js/lib/transition-intent/named-transition-intent.ts","lineNumber":249,"sourceCode":"        (oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params) || {};\n\n      let peek = objects[objects.length - 1];\n      let paramName = names[numNames]!;\n      if (isParam(peek)) {\n        params[paramName] = String(objects.pop());\n      } else {\n        // If we're here, this means only some of the params\n        // were string/number params, so try and use a param\n        // value from a previous handler.\n        if (oldParams.hasOwnProperty(paramName)) {\n          params[paramName] = oldParams[paramName];\n        } else {\n          missingParams.push(paramName);\n        }\n      }\n    }\n    if (missingParams.length > 0) {\n      throw new Error(\n        `You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route ${name}.` +\n          ` Missing params: ${missingParams}`\n      );\n    }\n\n    return new UnresolvedRouteInfoByParam(this.router, name, names, params);\n  }\n}\n","sourceCodeStart":231,"sourceCodeEnd":258,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/router_js/lib/transition-intent/named-transition-intent.ts#L231-L258","documentation":"router_js throws this from createParamHandlerInfo when building a transition by route name but too few string/numeric params were provided to fill every dynamic segment. Each dynamic segment must be satisfied by a supplied param or a context object; the missing ones are listed in the message.","triggerScenarios":"transitionTo('post', undefined) or transitionTo('post') where route 'post' has :post_id and no context object is given; params map from serialize() missing keys; supplying objects where strings/numbers are required so they don't count as params.","commonSituations":"Model hooks returning undefined so serialize() yields no id; link-to with a promise that hasn't resolved; renaming dynamic segments in the router map without updating serializers/callers.","solutions":["Provide a context object (model) instead of raw params so serialize() can derive them.","Ensure the model hook resolves (don't return undefined) so all dynamic segment keys exist in params.","Fix the route's serialize() to return keys matching every dynamic segment name.","Pass explicit params: transitionTo('post', params.post_id) with a defined string/number."],"exampleFix":"// before\nthis.transitionTo('post'); // :post_id unsatisfied\n// after\nthis.transitionTo('post', this.store.findRecord('post', id));","handlingStrategy":"validation","validationCode":"function canSerialize(route, model) {\n  const params = route.serialize?.(model, route.paramsFor?.(route.routeName)) ?? {};\n  const missing = Object.keys(route.fullRouteName ? dynamicNames : {}).filter(k => params[k] == null);\n  return missing.length === 0 ? null : missing;\n}\nconst missing = canSerialize(postRoute, post);\nif (missing) throw new Error('missing params: ' + missing);","typeGuard":"function hasAllParams(params, names) { return names.every(n => typeof params[n] === 'string' || typeof params[n] === 'number'); }","tryCatchPattern":"router.transitionTo('post', post).catch(e => {\n  if (e.message.includes(\"didn't provide enough string/numeric parameters\")) {\n    router.transitionTo('posts.index');\n  } else throw e;\n});","preventionTips":["Ensure model hooks always resolve (or explicitly redirect on failure).","Keep serialize() keys aligned with router map dynamic segment names.","Guard link-to/transitionTo against undefined models before transitioning.","Prefer passing resolved model objects over raw ids."],"tags":["routing","ember","dynamic-segments"],"backgroundTag":"missing-route-param","analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}