请问报错如何解决

来源:11-12 JWT实操:sign与解析jwt

慕粉3946981

2023-12-12

[Nest] 13064 - 2023/12/12 09:49:06 ERROR [ExceptionHandler] Nest can’t resolve dependencies of the JWT_MODULE_OPTIONS (?). Please make sure that the argument ConfigModule at index [0] is available in the JwtModule context.

Potential solutions:

  • Is JwtModule a valid NestJS module?
  • If ConfigModule is a provider, is it part of the current JwtModule?
  • If ConfigModule is exported from a separate @Module, is that module imported within JwtModule?
    @Module({
    imports: [ /* the Module containing ConfigModule */ ]
    })

Error: Nest can’t resolve dependencies of the JWT_MODULE_OPTIONS (?). Please make sure that the argument ConfigModule at index [0] is available in the JwtModule context.

Potential solutions:

  • Is JwtModule a valid NestJS module?

  • If ConfigModule is a provider, is it part of the current JwtModule?

  • If ConfigModule is exported from a separate @Module, is that module imported within JwtModule?
    @Module({
    imports: [ /* the Module containing ConfigModule */ ]
    })

    at Injector.lookupComponentInParentModules (C:\Users\xiebenyin\Desktop\nestjs2\nest-end\node_modules@nestjs\core\injector\injector.js:254:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Injector.resolveComponentInstance (C:\Users\xiebenyin\Desktop\nestjs2\nest-end\node_modules@nestjs\core\injector\injector.js:207:33)
    at resolveParam (C:\Users\xiebenyin\Desktop\nestjs2\nest-end\node_modules@nestjs\core\injector\injector.js:128:38)
    at async Promise.all (index 0)
    at Injector.resolveConstructorParams (C:\Users\xiebenyin\Desktop\nestjs2\nest-end\node_modules@nestjs\core\injector\injector.js:143:27)
    at Injector.loadInstance (C:\Users\xiebenyin\Desktop\nestjs2\nest-end\node_modules@nestjs\core\injector\injector.js:70:13)
    at Injector.loadProvider (C:\Users\xiebenyin\Desktop\nestjs2\nest-end\node_modules@nestjs\core\injector\injector.js:97:9)
    at C:\Users\xiebenyin\Desktop\nestjs2\nest-end\node_modules@nestjs\core\injector\instance-loader.js:56:13
    at async Promise.all (index 4)
    Waiting for the debugger to disconnect…这里是加粗文字

写回答

1回答

Brian

2023-12-12

你的配置呢?

你的代码呢?

从错误上来看,是由一个错误的引入没有找到对应的定义。

0
0

NestJS 入门到实战 前端必学服务端新趋势

近几年快速发展的Node.js框架,掌握未来前端工程师后端开发能力

569 学习 · 238 问题

查看课程