Skip to content

Commit c7ffaee

Browse files
Merge pull request #2086 from jakobwgnr/patch-2
Update migration.md
2 parents 80ec26a + 9881233 commit c7ffaee

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

content/migration.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,23 @@ Also, all `HttpException` errors thrown from your resolvers will be now automati
9191
#### RxJS
9292

9393
Make sure to upgrade to the latest version of the `rxjs` package (v7).
94+
95+
#### TestingModule / NestFactory
96+
97+
If you are currently supplying a string to `NestApplication#get` to retrieve an instance of some provider that was not injected using a string as a token (for instance, the `ConfigService` from `@nestjs/config`), you'll receive an error message like the following:
98+
```text
99+
Nest could not find ConfigService element (this provider does not exist in the current context)
100+
```
101+
102+
Please change this to the actual reference.
103+
Before:
104+
```typescript
105+
const app = await NestFactory.create<NestExpressApplication>(AppModule);
106+
const config = app.get<ConfigService>('ConfigService');
107+
```
108+
109+
Now:
110+
```typescript
111+
const app = await NestFactory.create<NestExpressApplication>(AppModule);
112+
const config = app.get<ConfigService>(ConfigService);
113+
```

0 commit comments

Comments
 (0)