Nx: NestJs need to have es6 in tsconfig target

Created on 16 Jan 2019  路  4Comments  路  Source: nrwl/nx

Prerequisites

Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.

  • [x] I am running the latest version
  • [ ] I checked the documentation and found no answer
  • [x] I checked to make sure that this issue has not already been filed
  • [x] I'm reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)

Expected Behavior

I merged my api repository using nest to my nrwl repository with the 7.3 version.
The ng serve nestjs-project is suppose to correctly run the API

Current Behavior

Nest wasn't able to handle request when using Nest middleware (infinite loading).
I found out the issue : https://github.com/nestjs/nest/issues/266.
Nestjs need to have tsconfig target set to es6, but by default the tsconfig generated by nrwl inherit from the global tsconfig (es5).

Other

I think it would be nice to override nrwl default tsconfig with the default nestjs tsconfig options when generating a new nestjs project

node bug

All 4 comments

Just to add onto this.
For Nodejs applications; since you control the version of target runtime (Nodejs), you have full control over what language features are available, therefore there's no advantage to downleveling. I've also observed performance improvements in some very specific CPU intensive workloads by not downleveling.
With the above in mind I personally always use 'esnext' for server applications

Hey guys. I opened a PR #1770
Is it, what you party people are looking for? If so, cool! If not, what needs to be changed?

I created a brand new nest app with the nest cli and compared the tsconfig
After my patch, there won't be much difference.

@Toxicable I would recommend sticking to the target version nestjs uses. At the time being it is es2017

@mehrad-rafigh Hi, that's exactly what I was looking for :)
I didn't test it yet but reading the code, it looks good !

Plus I agree to the fact that we should stick to nestjs' es version.

Folks. Is it still an issue?

Was this page helpful?
0 / 5 - 0 ratings