小编Luí*_*lva的帖子

prisma:类型“字符串”不可分配给类型“从不”

这是实际的错误

这是我的 DTO

export class CreateGradeDto {
  id: string;
  first_bimester?: number;
  second_bimester?: number;
  third_bimester?: number;
  fourth_bimester?: number;
  studentId: never;
  classId: string;
  createdAt: Date;
  updatedAt: Date;
}
Run Code Online (Sandbox Code Playgroud)

这是我的棱镜模型

model Grades {
  id              String   @id @unique
  first_bimester  Float
  second_bimester Float
  third_bimester  Float
  fourth_bimester Float
  student         Student  @relation(fields: [studentId], references: [id])
  studentId       String   @unique
  class           Classes  @relation(fields: [classId], references: [id])
  classId         String   @unique
  createdAt       DateTime @default(now())
  updatedAt       DateTime @default(now())
}
Run Code Online (Sandbox Code Playgroud)

这是学生模型

export class CreateStudentDto {
  id: string;
  name: string;
  cpf: string;
  createdAt: Date; …
Run Code Online (Sandbox Code Playgroud)

node.js typescript nestjs prisma

11
推荐指数
1
解决办法
2万
查看次数

Nest 无法解析 JwtService 的依赖关系(?)[JWT_MODULE_OPTIONS]

我收到这个错误


[Nest] 24356  - 10/03/2021, 11:19:31 AM     LOG [NestFactory] Starting Nest application...
[Nest] 24356  - 10/03/2021, 11:19:31 AM     LOG [InstanceLoader] PrismaModule dependencies initialized +51ms
[Nest] 24356  - 10/03/2021, 11:19:31 AM   ERROR [ExceptionHandler] Nest can't resolve dependencies of the JwtService (?). Please make sure that the argument JWT_MODULE_OPTIONS at index [0] is available in the JwtService context.

Potential solutions:
- If JWT_MODULE_OPTIONS is a provider, is it part of the current JwtService?
- If JWT_MODULE_OPTIONS is exported from a separate @Module, …
Run Code Online (Sandbox Code Playgroud)

authentication middleware node.js jwt nestjs

5
推荐指数
1
解决办法
4148
查看次数

标签 统计

nestjs ×2

node.js ×2

authentication ×1

jwt ×1

middleware ×1

prisma ×1

typescript ×1