Skip to content

Commit 395ccc4

Browse files
Hareloojmcdo29
andauthored
Apply suggestions from code review
Co-authored-by: Jay McDoniel <[email protected]>
1 parent b889105 commit 395ccc4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

content/faq/errors.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,21 @@ In the above image, the string in yellow is the host class of the dependency bei
8989
9090
Windows users who are using TypeScript version 4.9 and up may encounter this problem.
9191
This happens when you're trying to run your application in watch mode, e.g `npm run start:dev` and see an endless loop of the log messages:
92+
9293
```bash
9394
XX:XX:XX AM - File change detected. Starting incremental compilation...
9495
XX:XX:XX AM - Found 0 errors. Watching for file changes.
9596
```
97+
9698
When you're using the NestJS CLI to start your application in watch mode it is done by calling `tsc --watch`, and as of version 4.9 of TypeScript, a [new strategy](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#file-watching-now-uses-file-system-events) for detecting file changes is used which is likely to be the cause of this problem.
9799
In order to fix this problem, you need to add a setting to your tsconfig.json file after the `"compilerOptions"` option as follows:
100+
101+
```bash
98102
```bash
99103
"watchOptions": {
100104
"watchFile": "fixedPollingInterval"
101105
}
102106
```
107+
103108
This tells TypeScript to use the polling method for checking for file changes instead of file system events (the new default method), which can cause issues on some machines.
104109
You can read more about the `"watchFile"` option in [TypeScript documentation](https://www.typescriptlang.org/tsconfig#watch-watchDirectory).

0 commit comments

Comments
 (0)