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
{{ message }}
This repository has been archived by the owner on May 6, 2024. It is now read-only.
import{Logger}from'@nestjs/common';import{NestFactory}from'@nestjs/core';import{DocumentBuilder,SwaggerModule}from'@nestjs/swagger';import{patchNestJsSwagger}from'nestjs-zod';import{AppModule}from'./app.module';importenvfrom'./env';asyncfunctionbootstrap(){constlogger=newLogger('Main');constapp=awaitNestFactory.create(AppModule);if(env.devMode){patchNestJsSwagger();constdocumentBuilder=newDocumentBuilder().setTitle('URL Shortener backend').setVersion('1.0').build();constdocument=SwaggerModule.createDocument(app,documentBuilder);SwaggerModule.setup('docs',app,document);}logger.log(`App listening on port ${env.port}`);awaitapp.listen(env.port);}bootstrap();
Throws this exception:
path/backend/node_modules/.pnpm/@nestjs+swagger@6.2.1_bgmtsjzu2jyijhogwtog4e3a6e/node_modules/@nestjs/swagger/dist/services/schema-object-factory.js:89
if (this.isLazyTypeFunc(type)) {
^
TypeError: Cannot read properties of undefined (reading 'isLazyTypeFunc')
at exploreModelSchema (path/backend/node_modules/.pnpm/@nestjs+swagger@6.2.1_bgmtsjzu2jyijhogwtog4e3a6e/node_modules/@nestjs/swagger/dist/services/schema-object-factory.js:89:18)
at SchemaObjectFactory.e.exploreModelSchema (path/backend/node_modules/.pnpm/nestjs-zod@1.2.3_kwb2a4f7bk4iyyo5b2u32jtvxm/node_modules/nestjs-zod/dist/index.js:1:13958)
at path/backend/node_modules/.pnpm/@nestjs+swagger@6.2.1_bgmtsjzu2jyijhogwtog4e3a6e/node_modules/@nestjs/swagger/dist/services/schema-object-factory.js:33:36
at Array.map (<anonymous>)
at SchemaObjectFactory.createFromModel (path/backend/node_modules/.pnpm/@nestjs+swagger@6.2.1_bgmtsjzu2jyijhogwtog4e3a6e/node_modules/@nestjs/swagger/dist/services/schema-object-factory.js:20:45)
at exploreApiParametersMetadata (path/backend/node_modules/.pnpm/@nestjs+swagger@6.2.1_bgmtsjzu2jyijhogwtog4e3a6e/node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.js:35:55)
at path/backend/node_modules/.pnpm/@nestjs+swagger@6.2.1_bgmtsjzu2jyijhogwtog4e3a6e/node_modules/@nestjs/swagger/dist/swagger-explorer.js:72:45
at Array.reduce (<anonymous>)
at path/backend/node_modules/.pnpm/@nestjs+swagger@6.2.1_bgmtsjzu2jyijhogwtog4e3a6e/node_modules/@nestjs/swagger/dist/swagger-explorer.js:71:104
at path/backend/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js:13469:38
@PsclDev Hello! The problem is that PartialType accepts the regular class and searches for its fields using reflect-metadata. But ZodDto is another type of thing:
After looking through the issues I saw that this was already reported two times, which should be fixed with the MR #18, but seems still an Issue here.
My only dto:
main.ts
Throws this exception:
package.json - reduced to minimum
The text was updated successfully, but these errors were encountered: