docs.nestjs.com
docs.nestjs.com copied to clipboard
Update prisma.md
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
@jmcdo29 I stumbled on the same. I'd like to see it merged for the sake of the newbies.
I don't find this addition helpful (it should be obvious after reading other chapters).