question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`nest start` ignores exclude folders from tsconfig

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

nest start tries to compile files it shouldn’t - including *.d.ts definitions from node_modules. As the result trying to run nest with nest start results in over 1’000 errors while tsc compiles w/o any errors. The issue remains with any nest project on my machine, even a new one created using nest cli tool.

Minimum reproduction code

https://github.com/Shassk/test-nest-app

Steps to reproduce

  1. Take a nest app (in case of this example I’ve used a new one created with node path-to-nest\nest.js -- n test-nest-app)
  2. yarn install
  3. yarn start

Expected behavior

nest start follows tsconfig rules and excludes node_modules from compiling.

Package

Other package

No response

NestJS version

8.0.0

Packages versions

{
  // . . .
  "dependencies": {
    "@nestjs/common": "^8.0.0",
    "@nestjs/core": "^8.0.0",
    "@nestjs/platform-express": "^8.0.0",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^7.2.0"
  },
  "devDependencies": {
    "@nestjs/cli": "^8.0.0",
    "@nestjs/schematics": "^8.0.0",
    "@nestjs/testing": "^8.0.0",
    "@types/express": "^4.17.13",
    "@types/jest": "27.5.0",
    "@types/node": "^16.0.0",
    "@types/supertest": "^2.0.11",
    "@typescript-eslint/eslint-plugin": "^5.0.0",
    "@typescript-eslint/parser": "^5.0.0",
    "eslint": "^8.0.1",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "jest": "28.0.3",
    "prettier": "^2.3.2",
    "source-map-support": "^0.5.20",
    "supertest": "^6.1.3",
    "ts-jest": "28.0.1",
    "ts-loader": "^9.2.3",
    "ts-node": "^10.0.0",
    "tsconfig-paths": "4.0.0",
    "typescript": "^4.3.5"
  },
```

### Node.js version

16.14.0

### In which operating systems have you tested?

- [ ] macOS
- [X] Windows
- [ ] Linux

### Other

The issue persisted on 8.4.6 as well.

Also unlikely, but still possibly related: I have my projects on an exFAT MicroSD (E:\) with a symlink in `C:\...\Documents` pointing at the projects folder on E:\. Although I've tried to run `nest start` from both the actual location and the symlink path - the result doesn't change. So I doubt that's the reason.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jmcdo29commented, Jul 13, 2022

Nope, turns out we changed that at some point and I missed it. It’ll run the compiler either way

1reaction
Shasskcommented, Jul 13, 2022

The git@github.com:Shassk part didn’t want to work, so I’ll use https://github.com/Shassk instead. Hope that won’t be a problem? Install will take some time, my internet isn’t particularly fast.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NestJS - exclude folder under watch mode - Stack Overflow
But under npm run start:dev mode, every time I upload a file, Nest has detected file change and restarts server. How can I...
Read more >
Exclude a Folder from compilation with tsconfig.json in TS
Use the exclude option in your tsconfig.json file to exclude a folder from compilation in TypeScript. The exclude option changes what the include...
Read more >
TSConfig Option: rootDir - TypeScript
When TypeScript compiles files, it keeps the same directory structure in the output directory as exists in the input directory. For example, let's...
Read more >
Ignoring Code - Prettier
Use .prettierignore to ignore (i.e. not reformat) certain files and folders completely. Use “prettier-ignore” comments to ignore parts of files.
Read more >
tsconfig exclude folder - Code Examples & Solutions For This ...
Contributions From The Grepper Developer Community. Contents. Code Examples. exclude folder from typescript compiler tsconfig.json. Related Problems.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found