#Can't use Reflector.createDecorator()

9 messages · Page 1 of 1 (latest)

wet goblet
#

After writing code like underbelow

import { Reflector } from '@nestjs#0334/core';

export const AllowedRole = Reflector.createDecorator<>();

it said 'typeof Reflector' has no prooerty 'createDecorator'.

but it mentioned in Official Document in link below

https://docs.nestjs.com/fundamentals/execution-context#reflection-and-metadata

Is there any settings i need to do for using this feature?

untold trellisBOT
#

Please run the command npx -y @nestjs/cli info and paste the output in a code block. This will help us determine if there is a version issue in your packages and which version of nest we are triaging.

wet goblet
#

Ok it said like this

[System Information]
OS Version : macOS Unknown
NodeJS Version : v20.3.0
YARN Version : 1.22.19

[Nest CLI]
Nest CLI Version : 10.1.11

[Nest Platform Information]
platform-express version : 10.1.3
microservices version : 10.1.3
schematics version : 10.0.2
swagger version : 7.1.8
typeorm version : 10.0.0
testing version : 10.1.3
common version : 10.1.3
config version : 3.0.0
core version : 10.1.3
cli version : 10.1.11

wet goblet
#

@cunning seal After git clone Nest.js Core, It seems that same issue also occured in nestjs sample. When I look at reflector.service.d.ts, no other static method 'createDecorator' can't be found

cunning seal
#

You need 10.2.0

wet goblet
#

Can I update to 10.2.0 now?

#

Oh sry I check it now

#

Thank you!