Commit 039627c
authored
Add
Hi,
I'm following the official docs to learn Nest.js, and in the `Controllers` docs the snippet introducing `Request object` didn't compile in `app.controllers.ts` when doing `npm run start:dev` with the following error:
```
src/app.controller.ts:15:24 - error TS1272: A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled.
15 test(@Req() request: Request): string {
~~~~~~~
src/app.controller.ts:3:10
3 import { Request } from 'express';
~~~~~~~
'Request' was imported here.
```
Error was fixed when I added `type` to the import.
Using Node.js v24.8.0 and Nest.js 11.0.10, bootstrapped from the official CLI with `nest new <app>`. (`nest -v` => 11.0.10).type to express Request import in controllers.md1 parent 719e08a commit 039627c
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
0 commit comments