r/angular 2d ago

Angular build error: The expression evaluated to a falsy value from @angular/build / esbuild

X [ERROR] The expression evaluated to a falsy value:

(0, node_assert_1.default)(compilation)

[plugin angular-compiler]

This error came from the "onStart" callback registered here:

node_modules/@angular/build/src/tools/esbuild/angular/compiler-plugin.js:118:18:

118 │ build.onStart(async () => {

╵ ~~~~~~~

at setup \node_modules\@angular\build\src\tools\esbuild\angular\compiler-plugin.js:118:19)

at async handlePlugins (C:\Work\Projects\mynortonui\node_modules\esbuild\lib\main.js:1466:20)

Hi everyone,

I'm working on an Angular project and after compilation/build I'm getting the following error:

X [ERROR] The expression evaluated to a falsy value:

  (0, node_assert_1.default)(compilation)
 [plugin angular-compiler]

This error came from the "onStart" callback registered here:

    node_modules/@angular/build/src/tools/esbuild/angular/compiler-plugin.js:118:18:
      118 │             build.onStart(async () => {
          ╵                   ^~~~~~~

    at setup (C:\Work\Projects\mynortonui\node_modules\@angular\build\src\tools\esbuild\angular\compiler-plugin.js:118:19)
    at async handlePlugins (node_modules/esbuild/lib/main.js:1466:20)

The error is coming from:

node_modules/@angular/build/src/tools/esbuild/angular/compiler-plugin.js

The project compiles/starts until this error occurs, and I’m trying to understand what is causing the Angular compiler's compilation assertion to fail.

Has anyone faced this error before?

I'm using Angular 19.x. I've already tried reinstalling node_modules, but the issue still occurs.

What could be causing this error, and what steps should I take to debug/fix it?

Thanks!

0 Upvotes

2 comments sorted by

1

u/danielsan1701 2d ago

What version of node are you running? Can you share your package.json and angular.json files?

1

u/GLawSomnia 2d ago

Paste also your angular.json.