nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.58k stars 2.36k forks source link

webWorkerTsConfig not working #26861

Closed muhamedkarajic closed 3 months ago

muhamedkarajic commented 4 months ago

Current Behavior

I have been switching to esbuild and got my application into the state to compile and run. However when its built I end up in JIT compiler issue.

image image

Expected Behavior

I expected it to just work. Very weird that its working in the serve process but that its not working in the other build.

GitHub Repo

No response

Steps to Reproduce

Below the project.json

{
  "name": "SOME_CLIENT",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "projectType": "application",
  "prefix": "app",
  "sourceRoot": "apps/SOME_CLIENT/src",
  "tags": [],
  "targets": {
    "build": {
      "executor": "@angular-devkit/build-angular:application",
      "outputs": ["{options.outputPath}"],
      "options": {
        "outputPath": "dist/apps/SOME_CLIENT",
        "index": "apps/SOME_CLIENT/src/index.html",
        "browser": "apps/SOME_CLIENT/src/main.ts",
        "polyfills": ["zone.js", "@angular/localize/init"],
        "tsConfig": "apps/SOME_CLIENT/tsconfig.app.json",
        "inlineStyleLanguage": "scss",
        "assets": [
          "apps/SOME_CLIENT/src/favicon.ico",
          "apps/SOME_CLIENT/src/assets",
          "apps/SOME_CLIENT/src/manifest.webmanifest"
        ],
        "styles": ["apps/SOME_CLIENT/src/styles.scss"],
        "scripts": ["node_modules/jquery/dist/jquery.min.js"],
        "webWorkerTsConfig": "apps/SOME_CLIENT/tsconfig.worker.json"
      },
      "configurations": {
        "production": {
          "budgets": [
            {
              "type": "initial",
              "maximumWarning": "500kb"
            },
            {
              "type": "anyComponentStyle",
              "maximumWarning": "2kb"
            }
          ],
          "outputHashing": "all"
        },
        "development": {
          "optimization": false,
          "extractLicenses": false,
          "sourceMap": true
        }
      },
      "defaultConfiguration": "production"
    },
    "serve": {
      "executor": "@angular-devkit/build-angular:dev-server",
      "configurations": {
        "production": {
          "buildTarget": "SOME_CLIENT:build:production"
        },
        "development": {
          "buildTarget": "SOME_CLIENT:build:development"
        }
      },
      "defaultConfiguration": "development"
    },
    "extract-i18n": {
      "executor": "@angular-devkit/build-angular:extract-i18n",
      "options": {
        "buildTarget": "SOME_CLIENT:build"
      }
    },
    "lint": {
      "executor": "@nx/eslint:lint",
      "outputs": ["{options.outputFile}"],
      "options": {
        "lintFilePatterns": ["apps/SOME_CLIENT/**/*.ts", "apps/SOME_CLIENT/**/*.html"]
      }
    },
    "test": {
      "executor": "@nx/jest:jest",
      "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
      "options": {
        "jestConfig": "apps/SOME_CLIENT/jest.config.ts",
        "webWorkerTsConfig": "apps/SOME_CLIENT/tsconfig.worker.json"
      }
    },
    "serve-static": {
      "executor": "@nx/web:file-server",
      "options": {
        "buildTarget": "SOME_CLIENT:build",
        "staticFilePath": "dist/apps/SOME_CLIENT/browser"
      }
    }
  }
}

Nx Report

Node   : 18.20.0
OS     : darwin-arm64
npm    : 10.5.0

nx                 : 19.3.1
@nx/js             : 19.3.1
@nx/jest           : 19.3.1
@nx/linter         : 19.3.1
@nx/eslint         : 19.3.1
@nx/workspace      : 19.3.1
@nx/angular        : 19.3.1
@nx/cypress        : 19.3.1
@nx/devkit         : 19.3.1
@nx/eslint-plugin  : 19.3.1
@nrwl/tao          : 19.3.1
@nx/web            : 19.3.1
@nx/webpack        : 19.3.1
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/cypress/plugin
@nx/eslint/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

I have also tried package.json with:

"build": {
   "executor": "@nx/angular:browser-esbuild" and
}
"serve": {
   "executor": "@nx/angular:dev-server",
}

but then on npm run serve it shows me a warrning that its not supposed so I went with the angular compiler, as recomended in #26669, and now ended up with the same issue.

muhamedkarajic commented 3 months ago

@Coly010 please help!

muhamedkarajic commented 3 months ago

When I use the other builder I get:

The 'webWorkerTsConfig' option is not yet supported by this builder.
image
muhamedkarajic commented 3 months ago

@alan-agius4 Can you check this? Its related to https://github.com/angular/angular-cli/issues/25101

Coly010 commented 3 months ago

Hey @muhamedkarajic !

I can see you're using the builders from the Angular devkit. In this case, it's very unlikely that the issue lies with Nx as it is the Angular builder's that are invoked. Not Nx.

It would be worth raising an issue on the Angular CLI repo.

muhamedkarajic commented 3 months ago

Hey @muhamedkarajic !

I can see you're using the builders from the Angular devkit. In this case, it's very unlikely that the issue lies with Nx as it is the Angular builder's that are invoked. Not Nx.

It would be worth raising an issue on the Angular CLI repo.

I wrote just there that I tried Nx things as well and it did not work. It shows me a warrning, dose anyone know why by Nx it shows that warrning?

image
muhamedkarajic commented 3 months ago

Hm I found this: https://github.com/angular/angular-cli/issues/28078

Will see next work week to get a look at it. Sorry @Coly010 after all looks like Angular issue.

github-actions[bot] commented 2 months ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.