#Nest throws an internal server error despite specifying ConflictException
40 messages · Page 1 of 1 (latest)
@Post(":multiTradeId/acknowledge")
@HttpCode(HttpStatus.OK)
async acknowledgeMultiTrade(@Param("multiTradeId") multiTradeId: string) {
throw new BadRequestException("Not implemented.");
await this.multiTradeService.acknowledge(multiTradeId);
}
{
"statusCode": 500,
"message": "Internal server error"
}
Everything is udated to v10?
idk why i said that in the project im in its v9
Is everything on the same nest version?
i believe so
npx nest info?
Please run the command npx -y @nestjs/cli info and paste the output in a code block. This will help us determine if there is a version issue in your packages and which version of nest we are triaging.
What's the stack trace in the terminal?
i assumed it was a package version different from another so i made sure all versions were the same
(it sa monorepo)
for each sub app
Oh boy. what kind of monorepo?
nothing big just two small sub apps and i have core and common installed at root
turborepo
this is the more interesting error
Do you have a common node_modules or a node_modules per app?
yea using pnpm so they all link back to the same place
Don't care that they link back. Does each app have a node_modules with @nestjs/common or @nestjs/core in it?
Okay, that's an issue due to how JS realms work
Well, which is it?
That might be an issue
Because @nestjs/platform-fastify has peer deps on @nestjs/common
does that explain the type error im getting for FastifyAdapter
There's a decent chance, yeah
i'll try installing it at root then
Especially if it doesn't match the common and core version exactly
after i tried making sure all packages were the same version i started getting this error (instead of the app running and not handling the thrown error properly)
Nest can't resolve dependencies of the EventSubscribersLoader (DiscoveryService, EventEmitter, EventsMetadataAccessor, MetadataScanner, ?). Please make sure that the argument ModuleRef at index [4] is available in the EventEmitterModule context.
I remember this error and its usually when you have a version mismatch, I just fixed that by pinning versions (9.4.0 vs ^9.4.0). So now I'm back to issue with the http error not being handled properly
does this clear up it being a version mismatch?
Yeah, if ModuleRef or Reflector ever show up, it's usually a mutliple version install issue or version mismatch