You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add type to express Request import in controllers.md
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).
0 commit comments