#35783·nx

Newly generated nestjs application does not fail build with type errors

Author: gbublysCreated May 24, 2026Updated Sep 29, 2026
Labelstype: bugscope: nodepriority: medium

Current Behavior

A NestJS application added into freshly generated minimal workspace builds with type errors even though it should fail.

Expected Behavior

The application fails to build and throws a type error.

GitHub Repo

https://github.com/gbublys/failing-nx-nestjs-boilerplate

Steps to Reproduce

  1. Create a new workspace with: npx create-nx-workspace workspace
  2. Add @nx/nest dependency with: yarn add -W @nx/nest
  3. Add new nestjs application with yarn nx g @nx/nest:app apps/backend
  4. Modify any backend typescript file to include error, for example add the following line in apps/backend/src/main.ts: const shouldFailOnThisLIne: number = 'HELLO WORLD';
  5. Build application with: yarn nx build backend

The application is built, even though it should fail with an error stating that String cannot be assigned to Number.

Nx Report

bash
NX   Report complete - copy this into the issue template

Node           : 24.14.0
OS             : linux-x64
Native Target  : x86_64-linux
yarn           : 1.22.22
daemon         : Available

nx                 : 22.7.2
@nx/js             : 22.7.3
@nx/eslint         : 22.7.3
@nx/workspace      : 22.7.3
@nx/jest           : 22.7.3
@nx/devkit         : 22.7.3
@nx/eslint-plugin  : 22.7.3
@nx/nest           : 22.7.3
@nx/node           : 22.7.3
@nx/web            : 22.7.3
@nx/webpack        : 22.7.3
@nx/docker         : 22.7.3
typescript         : 5.9.3
---------------------------------------
Registered Plugins:
@nx/js/typescript
@nx/webpack/plugin
@nx/eslint/plugin
@nx/jest/plugin
---------------------------------------
Cache Usage: 9.60 KB / 93.68 GB
---------------------------------------
The following packages should match the installed version of nx
  - @nx/[email protected]
  - @nx/[email protected]
  - @nx/[email protected]
  - @nx/[email protected]
  - @nx/[email protected]
  - @nx/[email protected]
  - @nx/[email protected]
  - @nx/[email protected]
  - @nx/[email protected]
  - @nx/[email protected]
  - @nx/[email protected]

To fix this, run `nx migrate [email protected]`
---------------------------------------
⚠️ Multiple Nx versions detected

Your workspace uses [email protected], but other packages depend on a different version:
  - @nx/eslint-plugin → @nx/js → @nx/workspace → [email protected]

These packages should not have nx as a dependency. Please report this issue to the package maintainers.
Run `yarn why [email protected]` for more details.

Failure Logs

bash
It does not fail, even though it sohuld

Package Manager Version

yarn

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Application generated with npx create-nx-workspace my-workspace --preset=nest command fails build process when there are type related issues in the code in nestjs application.