{"id":"2dcad16f58d790b4","repo":"nestjs/nest","slug":"http-adapter-does-not-support-filtering-on-version","errorCode":null,"errorMessage":"HTTP adapter does not support filtering on version","messagePattern":"HTTP adapter does not support filtering on version","errorType":"http","errorClass":"InternalServerErrorException","httpStatus":500,"severity":"error","filePath":"packages/platform-express/adapters/express-adapter.ts","lineNumber":334,"sourceCode":"  }\n\n  public setLocal(key: string, value: any) {\n    this.instance.locals[key] = value;\n    return this;\n  }\n\n  public getType(): string {\n    return 'express';\n  }\n\n  public applyVersionFilter(\n    handler: Function,\n    version: VersionValue,\n    versioningOptions: VersioningOptions,\n  ): VersionedRoute {\n    const callNextHandler: VersionedRoute = (req, res, next) => {\n      if (!next) {\n        throw new InternalServerErrorException(\n          'HTTP adapter does not support filtering on version',\n        );\n      }\n      return next();\n    };\n\n    if (\n      version === VERSION_NEUTRAL ||\n      // URL Versioning is done via the path, so the filter continues forward\n      versioningOptions.type === VersioningType.URI\n    ) {\n      const handlerForNoVersioning: VersionedRoute = (req, res, next) =>\n        handler(req, res, next);\n\n      return handlerForNoVersioning;\n    }\n\n    // Custom Extractor Versioning Handler","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/nestjs/nest/blob/6ec0e2783d15290732447f304d8549b591b9749e/packages/platform-express/adapters/express-adapter.ts#L316-L352","documentation":"Error \"HTTP adapter does not support filtering on version\" thrown in nestjs/nest.","triggerScenarios":"Thrown at packages/platform-express/adapters/express-adapter.ts:334 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Express does not support per-route version filtering for the configured versioning type; use URI versioning or upgrade/verify your NestJS version supports the chosen type with Express.","Avoid mixing VERSION_NEUTRAL filtering with a versioning type the Express adapter cannot filter on.","Configure versioning once with enableVersioning({ type: VersioningType.URI }) and rely on path-based routing."],"exampleFix":"app.enableVersioning({ type: VersioningType.URI });\n// routes: @Controller({ path: 'cats', version: '1' })","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"6ec0e2783d15290732447f304d8549b591b9749e","analyzedAt":"2026-08-03T17:42:23.673Z","schemaVersion":2}