docs.nestjs.com icon indicating copy to clipboard operation
docs.nestjs.com copied to clipboard

Update prisma.md

Open RyuNIshimura opened this issue 3 years ago • 1 comments

I updated it because it didn't work when I implemented it the same way as in the documentation.

Error

app_1    | [Nest] 42  - 08/27/2021, 11:38:49 AM   ERROR [ExceptionHandler] Nest can't resolve dependencies of 
the AppController (AppService, ?). Please make sure that the argument UserService at index [1] is available 
in the AppModule context.

Replace the contents of the app.module.ts file with the following code and it will work.

import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { PrismaService } from './prisma.service';
import { UserService } from './user.service';
import { PostService } from './post.service';

@Module({
  imports: [],
  controllers: [AppController],
  providers: [AppService, PrismaService, UserService, PostService],
})
export class AppModule {}

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/nestjs/docs.nestjs.com/blob/master/CONTRIBUTING.md

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [x] Docs
  • [ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

RyuNIshimura avatar Aug 27 '21 11:08 RyuNIshimura

@jmcdo29 I stumbled on the same. I'd like to see it merged for the sake of the newbies.

utamori avatar Nov 22 '21 05:11 utamori

I don't find this addition helpful (it should be obvious after reading other chapters).

kamilmysliwiec avatar Feb 03 '23 14:02 kamilmysliwiec