Unable to run angular application with esbuild builder inside stackblitz

706 views Asked by At

Unable to run angular application with esbuild builder inside stackblitz

⠴ Building...✘ [ERROR] Unable to deserialize cloned data. [plugin angular-compiler]

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

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

    at setup (/home/projects/etn2qr-fcdsqt/node_modules/@angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin.js:89:19)
    at async handlePlugins (/home/projects/etn2qr-fcdsqt/node_modules/esbuild/lib/main.js:1330:9)


✘ [ERROR] File 'src/main.ts' is missing from the TypeScript compilation. [plugin angular-compiler]

  Ensure the file is part of the TypeScript program via the 'files' or 'include' property.

Also main.ts is mentioned inside tsconfig.app.json

Stackblitz - https://stackblitz.com/edit/etn2qr-fcdsqt?file=package.json,angular.json,tsconfig.app.json

Update - this seems like an issue related to stackblitz as the downloaded code is working fine on local

1

There are 1 answers

0
Simon_Weaver On

I had the same issue locally with an Angular 17 project on Windows when running @angular-devkit/build-angular:browser-esbuild (not the :application builder)

I did not expect this to work (because I am not aware of using any symlinks!), but adding the following fixed it:

architect/build/options:
{
   "preserveSymlinks": true 
}

Source: https://forum.ionicframework.com/t/error-updated-angular-to-version-17-when-i-compile/237632/2