nrwl / nx

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

Express up is not able to run/be build from non root folders #3316

Closed Akxe closed 4 years ago

Akxe commented 4 years ago

Current Behavior

nx server express-app will not work if run from any folder outside of root!

Expected Behavior

I expect same behaviour as from other apps. To be able to run it from any project folder.

Steps to Reproduce

Create any project with two apps of which one is Express.

From angular.json

"server": {
  "root": "apps/server",
  "sourceRoot": "apps/server/src",
  "projectType": "application",
  "prefix": "server",
  "schematics": {},
  "architect": {
    "build": {
      "builder": "@nrwl/node:build",
      "options": {
        "outputPath": "dist/apps/server",
        "main": "apps/server/src/main.ts",
        "tsConfig": "apps/server/tsconfig.app.json",
        "assets": ["apps/server/src/assets"]
      },
      "configurations": {
        "production": {
          "optimization": true,
          "extractLicenses": true,
          "inspect": false,
          "fileReplacements": [
            {
              "replace": "apps/server/src/environments/environment.ts",
              "with": "apps/server/src/environments/environment.prod.ts"
            }
          ]
        }
      }
    },
    "serve": {
      "builder": "@nrwl/node:execute",
      "options": {
        "buildTarget": "server:build"
      }
    },
    "lint": {
      "builder": "@angular-devkit/build-angular:tslint",
      "options": {
        "tsConfig": ["apps/server/tsconfig.app.json"],
        "exclude": ["**/node_modules/**", "!apps/server/**/*"]
      }
    }
  }
},

Failure Logs

TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'.

ERROR in C:\Users\akxe\Documents\Programming\rita\tmp\apps\server\tsconfig.generated.json
[tsl] ERROR
      TS5083: Cannot read file 'C:/Users/akxe/Documents/Programming/rita/libs/client/apps/server/tsconfig.app.json'.

ERROR in C:/Users/akxe/Documents/Programming/rita/apps/server/src/main.ts
Module build failed (from C:/Users/akxe/Documents/Programming/rita/node_modules/ts-loader/index.js):
Error: error while parsing tsconfig.json
    at Object.loader (C:\Users\akxe\Documents\Programming\rita\node_modules\ts-loader\dist\index.js:19:18)
There was an error with the build. See above.

Environment

  @nrwl/angular : 9.5.1
  @nrwl/cli : 9.5.1
  @nrwl/cypress : 9.5.1
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : 9.5.1
  @nrwl/jest : 9.5.1
  @nrwl/linter : 9.5.1
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : 9.5.1
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 9.5.1
  @nrwl/web : Not Found
  @nrwl/workspace : 9.5.1
  typescript : 3.9.6
github-actions[bot] commented 1 year 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.