{"record":{"id":"0ef28cb0a1d4d05c","repo":"vercel/next.js","slug":"expected-sample-param-value-for-segment-rawsegm","errorCode":null,"errorMessage":"Expected sample param value for segment '${rawSegment}' to be an array of strings, got ${typeof paramValue}","messagePattern":"Expected sample param value for segment '(.+?)' to be an array of strings, got (.+?)","errorType":"validation","errorClass":"InstantValidationError","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/app-render/instant-validation/instant-samples.ts","lineNumber":430,"sourceCode":" */\nfunction createPathnameFromRouteAndSampleParams(route: string, params: Params) {\n  let interpolatedSegments: string[] = []\n  const rawSegments = route.split('/')\n  for (const rawSegment of rawSegments) {\n    const param = getSegmentParam(rawSegment)\n    if (param) {\n      switch (param.paramType) {\n        case 'catchall':\n        case 'optional-catchall': {\n          let paramValue = params[param.paramName]\n          if (paramValue === undefined) {\n            // The value for the param was not provided. `usePathname` will detect this and throw\n            // before this can surface to userspace. Use `[...NAME]` as a placeholder for the param value\n            // in case it pops up somewhere unexpectedly.\n            paramValue = [rawSegment]\n          } else if (!Array.isArray(paramValue)) {\n            // NOTE: this happens outside of render, so we don't need `trackMissingSampleErrorAndThrow`\n            throw new InstantValidationError(\n              `Expected sample param value for segment '${rawSegment}' to be an array of strings, got ${typeof paramValue}`\n            )\n          }\n          interpolatedSegments.push(\n            ...paramValue.map((v) => encodeURIComponent(v))\n          )\n          break\n        }\n        case 'dynamic': {\n          let paramValue = params[param.paramName]\n          if (paramValue === undefined) {\n            // The value for the param was not provided. `usePathname` will detect this and throw\n            // before this can surface to userspace. Use `[NAME]` as a placeholder for the param value\n            // in case it pops up somewhere unexpectedly.\n            paramValue = rawSegment\n          } else if (typeof paramValue !== 'string') {\n            // NOTE: this happens outside of render, so we don't need `trackMissingSampleErrorAndThrow`\n            throw new InstantValidationError(","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/app-render/instant-validation/instant-samples.ts#L412-L448","documentation":"Type check while interpolating sample params into a route pathname for instant validation: a catchall or optional-catchall segment's param value in the samples config was expected to be an array of strings but had another type. The faulting input is the samples entry for that param in the route's validation config.","triggerScenarios":"A catch-all sample param value is not an array of strings.","commonSituations":"Instant validation sample data provides a wrong type for a catch-all segment param.","solutions":["Provide an array of strings for catch-all sample params in instant validation config."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}