{"record":{"id":"af01c1bfe00d4e16","repo":"nestjs/nest","slug":"warning-moduleref-name-module-exposes-a-con","errorCode":null,"errorMessage":"Warning! \"${moduleRef.name}\" module exposes a \"configure\" method that throws an exception in the preview mode (possibly due to missing dependencies). Note: you can ignore this message, just be aware that some of those conditional middlewares will not be reflected in your graph.","messagePattern":"Warning! \"(.+?)\" module exposes a \"configure\" method that throws an exception in the preview mode \\(possibly due to missing dependencies\\)\\. Note: you can ignore this message, just be aware that some of those conditional middlewares will not be reflected in your graph\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/middleware/middleware-module.ts","lineNumber":119,"sourceCode":"    const { instance } = moduleRef;\n    if (!instance.configure) {\n      return;\n    }\n    const middlewareBuilder = new MiddlewareBuilder(\n      this.routesMapper,\n      this.httpAdapter,\n      this.routeInfoPathExtractor,\n    );\n    try {\n      await instance.configure(middlewareBuilder);\n    } catch (err) {\n      if (!this.appOptions.preview) {\n        throw err;\n      }\n      const warningMessage =\n        `Warning! \"${moduleRef.name}\" module exposes a \"configure\" method that throws an exception in the preview mode` +\n        ` (possibly due to missing dependencies). Note: you can ignore this message, just be aware that some of those conditional middlewares will not be reflected in your graph.`;\n      this.logger.warn(warningMessage);\n    }\n\n    if (!(middlewareBuilder instanceof MiddlewareBuilder)) {\n      return;\n    }\n    const config = middlewareBuilder.build();\n    middlewareContainer.insertConfig(config, moduleKey);\n  }\n\n  public async registerMiddleware(\n    middlewareContainer: MiddlewareContainer,\n    applicationRef: any,\n  ) {\n    const configs = middlewareContainer.getConfigurations();\n    const registerAllConfigs = async (\n      moduleKey: string,\n      middlewareConfig: MiddlewareConfiguration[],\n    ) => {","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/nestjs/nest/blob/dd75d7bd8c5e88048587e6768d36eb695f3e7a25/packages/core/middleware/middleware-module.ts#L101-L137","documentation":"Error \"Warning! \"${moduleRef.name}\" module exposes a \"configure\" method that throws an exception in the preview mode (possibly due to missing dependencies). Note: you can ignore this message, just be aware that some of those conditional middlewares will not be reflected in your graph.\" thrown in nestjs/nest.","triggerScenarios":"Thrown at packages/core/middleware/middleware-module.ts:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dd75d7bd8c5e88048587e6768d36eb695f3e7a25","analyzedAt":"2026-08-21T19:39:39.867Z","contentChangedAt":"2026-08-21T19:39:39.867Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}