Skip to content

Commit 5517996

Browse files
committed
docs(faq): drop "errors monorepo" section
1 parent 14a885b commit 5517996

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

content/faq/errors.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## Common errors
1+
### Common errors
22

33
During your development with NestJS, you may encounter various errors as you learn the framework.
44

5-
### "Cannot resolve dependency" error
5+
#### "Cannot resolve dependency" error
66

77
Probably the most common error message is about Nest not being able to resolve dependencies of a provider. The error message usually looks something like this:
88

@@ -29,9 +29,7 @@ If the `<unknown_token>` above is the string `Object`, it means that you're inje
2929
3030
Also, make sure you didn't end up injecting the provider on itself because self-injections are not allowed on NetJS. When this happens, `<unknown_token>` will likely be equal to `<provider>`.
3131

32-
#### Error on monorepos
33-
34-
If you are in a monorepo setup, you may face the same error as above but for core provider called `ModuleRef` as a `<unknown_token>`:
32+
If you are in a **monorepo setup**, you may face the same error as above but for core provider called `ModuleRef` as a `<unknown_token>`:
3533

3634
```bash
3735
Nest can't resolve dependencies of the <provider> (?).
@@ -59,7 +57,7 @@ Solutions:
5957
6058
- For **Yarn** Workspaces, use the [nohoist feature](https://classic.yarnpkg.com/blog/2018/02/15/nohoist) to prevent hosting the package `@nestjs/core`.
6159
62-
### "Circular dependency" error
60+
#### "Circular dependency" error
6361
6462
Occasionally you'll find it difficult to avoid [circular dependencies](https://docs.nestjs.com/fundamentals/circular-dependency) in your application. You'll need to take some steps to help Nest resolve these. Errors that arise from circular dependencies look like this:
6563
@@ -77,7 +75,7 @@ Scope [<module_import_chain>]
7775
7876
Circular dependencies can arise from both providers depending on each other, or typescript files depending on each other for constants, such as exporting constants from a module file and importing them in a service file. In the latter case, it is advised to create a separate file for your constants. In the former case, please follow the guide on circular dependencies and make sure that both the modules **and** the providers are marked with `forwardRef`.
7977
80-
### Debugging dependency errors
78+
#### Debugging dependency errors
8179
8280
Along with just manually verifying your dependencies are correct, as of Nest 8.1.0 you can set the `NEST_DEBUG` environment variable to a string that resolves as truthy, and get extra logging information while Nest is resolving all of the dependencies for the application.
8381

0 commit comments

Comments
 (0)