Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

NestJS. This is probably the best thing that happened to Node.js ecosystem to write maintainable backends.

https://nestjs.com/



While I really hope that Nest.js eventually succeeds and provides a reliable framework to write maintainable web applications, my experience with it has been, in a word, frustrating. I find the integration with remaining ecosystem (testing, databases, etc.) quite poor.

For context, these are my experiences from the last few months of using Nest.js in a project we're working on at my company.

- It strongly encourages you to use TypeORM, which is just not production ready and has many (sometimes subtle) issues [1]

- Logging is often extremely bad. I've encountered issues where I made a mistake in my app bootstrapping code and there were no errors logged, but the application simply didn't start. Then I had to play a very frustrating game of commenting out pieces of code until the application would start again

- Nest.js error classes (HttpException and those that inherit from it, such as BadRequestException) do not properly inherit from built-in Error, which means that when your tests fail, the only output you'll get is "Error: [Object object]" printed to the console without a proper stack trace.

- We used their GraphQL module and when we tried to send a few MB of data to the client for initial state, memory usage would balloon to hundreds(!) of megabytes from a single request.

- Misconfiguring any part of GraphQL would again lead to an error being thrown somewhere inside their libraries, with a message like "Cannot read propery 'target' of undefined" with no stack trace or any indication of where the problem might be

- Documentation is lacking and doesn't do a proper job of documenting the features. Usually it's just a hello-world style example without much depth

That's just my experience, maybe I was just "using it wrong". But it was definitely far from a smooth experience and lead me to waste countless hours trying to track down and fix obscure issues.

If you're thinking about using Nest.js, I would recommend that you ditch TypeORM and use something else, I also wouldn't recommend using GraphQL with Nest.

[1] https://github.com/typeorm/typeorm/issues/2065


I've never had a positive experience with Node.js and SQL databases in general to be honest. I don't really see the point in using it outside of familiarity with JavaScript. Nest + TypeORM might be as good as it gets in the Node world right now, but pretty much every other major platform has better ORMs and better frameworks. Node might have better performance and concurrency options than some of the others, but it's not the best at those either. It's not really clear to me that it's actually the best at anything. My preference is honestly just to avoid it. In my experience there is always a better tool.


Personally I've had an ok experience with Objection.js, which is definitely better than TypeORM. But otherwise I agree.

I'm learning Elixir right now, which has some really high quality and well documented libraries and tooling, despite being a young language by itself.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: