{"record":{"id":"ce1eea811ae50094","repo":"vercel/next.js","slug":"optional-route-parameters-are-not-yet-supported","errorCode":null,"errorMessage":"Optional route parameters are not yet supported (\"${urlPaths[0]}\").","messagePattern":"Optional route parameters are not yet supported \\(\"(.+?)\"\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/shared/lib/router/utils/sorted-routes.ts","lineNumber":181,"sourceCode":"          this.optionalRestSlugName = segmentName\n          // nextSegment is overwritten to [[...]] so that it can later be sorted specifically\n          nextSegment = '[[...]]'\n        } else {\n          if (this.optionalRestSlugName != null) {\n            throw new Error(\n              `You cannot use both an optional and required catch-all route at the same level (\"[[...${this.optionalRestSlugName}]]\" and \"${urlPaths[0]}\").`\n            )\n          }\n\n          handleSlug(this.restSlugName, segmentName)\n          // slugName is kept as it can only be one particular slugName\n          this.restSlugName = segmentName\n          // nextSegment is overwritten to [...] so that it can later be sorted specifically\n          nextSegment = '[...]'\n        }\n      } else {\n        if (isOptional) {\n          throw new Error(\n            `Optional route parameters are not yet supported (\"${urlPaths[0]}\").`\n          )\n        }\n        handleSlug(this.slugName, segmentName)\n        // slugName is kept as it can only be one particular slugName\n        this.slugName = segmentName\n        // nextSegment is overwritten to [] so that it can later be sorted specifically\n        nextSegment = '[]'\n      }\n    }\n\n    // If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode\n    if (!this.children.has(nextSegment)) {\n      this.children.set(nextSegment, new UrlNode())\n    }\n\n    this.children\n      .get(nextSegment)!","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/shared/lib/router/utils/sorted-routes.ts#L163-L199","documentation":"_insert throws when a non-catch-all bracketed segment uses double-bracket (optional parameter) syntax. The Pages Router only supports optional catch-alls ([[...slug]]), not optional plain params like [[param]], so such segments cannot be routed.","triggerScenarios":"A route uses optional route parameters syntax.","commonSituations":"A segment pattern implying optional params that Next.js does not yet support.","solutions":["Remove the optional route parameter syntax; use catch-all segments instead."],"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-14T00:17:10.932Z"}