@nestjs-plus/discovery possible issue with nestjs 10.3.0
horrendo opened this issue · comments
After upgrading our application from nestjs 9.4.3 to 10.3.0, we get this error when trying to start the application:
$ ts-node -r tsconfig-paths/register src/main.ts
[Nest] 48172 - 21/12/2023, 7:45:01 pm LOG [main] Running unsullied app on Node.js v20.10.0.
[Nest] 48172 - 21/12/2023, 7:45:01 pm LOG [MasterHost] sqlite database found
[Nest] 48172 - 21/12/2023, 7:45:01 pm LOG [MasterHost] Opening database ./master-host.db
[Nest] 48172 - 21/12/2023, 7:45:01 pm LOG [NestFactory] Starting Nest application... +15ms
[Nest] 48172 - 21/12/2023, 7:45:01 pm LOG [InstanceLoader] TemplateModule dependencies initialized +55ms
[Nest] 48172 - 21/12/2023, 7:45:01 pm LOG [InstanceLoader] AppEventModule dependencies initialized +1ms
[Nest] 48172 - 21/12/2023, 7:45:01 pm LOG [InstanceLoader] ConfigModule dependencies initialized +0ms
[Nest] 48172 - 21/12/2023, 7:45:01 pm LOG [InstanceLoader] ConfigModule dependencies initialized +3ms
[Nest] 48172 - 21/12/2023, 7:45:01 pm LOG [InstanceLoader] RedacterModule dependencies initialized +0ms
[Nest] 48172 - 21/12/2023, 7:45:01 pm ERROR [ExceptionHandler] Cannot read properties of undefined (reading 'values')
TypeError: Cannot read properties of undefined (reading 'values')
at /Users/stbaldwin/git/unsullied/node_modules/@nestjs-plus/discovery/src/discovery.service.ts:68:50
at arrayMap (/Users/stbaldwin/git/unsullied/node_modules/lodash/lodash.js:653:23)
at map (/Users/stbaldwin/git/unsullied/node_modules/lodash/lodash.js:9622:14)
at Function.flatMap (/Users/stbaldwin/git/unsullied/node_modules/lodash/lodash.js:9325:26)
at new DiscoveryService (/Users/stbaldwin/git/unsullied/node_modules/@nestjs-plus/discovery/src/discovery.service.ts:67:7)
at Injector.instantiateClass (/Users/stbaldwin/git/unsullied/node_modules/@nestjs/core/injector/injector.js:365:19)
at callback (/Users/stbaldwin/git/unsullied/node_modules/@nestjs/core/injector/injector.js:65:45)
at async Injector.resolveConstructorParams (/Users/stbaldwin/git/unsullied/node_modules/@nestjs/core/injector/injector.js:144:24)
at async Injector.loadInstance (/Users/stbaldwin/git/unsullied/node_modules/@nestjs/core/injector/injector.js:70:13)
at async Injector.loadProvider (/Users/stbaldwin/git/unsullied/node_modules/@nestjs/core/injector/injector.js:97:9)
error Command failed with exit code 1.
I originally reported this on the nestjs repo but was told to instead report it here.
Here's my output from nest info
:
[1 ~/git/unsullied] yarn nest info
yarn run v1.22.21
$ /Users/stbaldwin/git/unsullied/node_modules/.bin/nest info
_ _ _ ___ _____ _____ _ _____
| \ | | | | |_ |/ ___|/ __ \| | |_ _|
| \| | ___ ___ | |_ | |\ `--. | / \/| | | |
| . ` | / _ \/ __|| __| | | `--. \| | | | | |
| |\ || __/\__ \| |_ /\__/ //\__/ /| \__/\| |_____| |_
\_| \_/ \___||___/ \__|\____/ \____/ \____/\_____/\___/
[System Information]
OS Version : macOS Unknown
NodeJS Version : v20.10.0
YARN Version : 1.22.21
[Nest CLI]
Nest CLI Version : 10.2.1
[Nest Platform Information]
platform-express version : 10.3.0
testing version : 10.3.0
common version : 10.3.0
core version : 10.3.0
cli version : 10.2.1
version : 2.0.2
✨ Done in 0.45s.
Thanks for your help !!
Sorry about the noise. I hadn't realised the package name had changed from @nestjs-plus/discovery
to @golevelup/nestjs-discovery
.