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.
I encountered an issue that involves TypeScript type inference and named exports. The problem arises when attempting to export a variable created via zodToOpenAPI, which leads to an error related to the ExtendedSchemaObject
Steps to Reproduce:
import { createZodDto, zodToOpenAPI } from 'nestjs-zod';
import { z } from 'nestjs-zod/z';
export const EnvConfigSchema = z.object({
PORT: z.coerce.number().int().positive().describe('Port number'),
});
export const EnvConfigApi = zodToOpenAPI(EnvConfigSchema);
Expected Behavior:
Typescript intellisense should not scream.
Actual Behavior:
Exported variable EnvConfigApi has or is using name ExtendedSchemaObject from external module "node_modules/.pnpm/nestjs-zod@2.3.3_@nestjs+common@10.0.0_@nestjs+core@10.0.0_@nestjs+swagger@7.1.8_zod@3.22.0/node_modules/nestjs-zod/dist/index" but cannot be named.
Proposed Solution:
The interface ExtendedSchemaObject should be included in the module's exports.
This resolves the issue.
The text was updated successfully, but these errors were encountered:
Descripttion
I encountered an issue that involves TypeScript type inference and named exports. The problem arises when attempting to export a variable created via
zodToOpenAPI
, which leads to an error related to theExtendedSchemaObject
Steps to Reproduce:
Expected Behavior:
Typescript intellisense should not scream.
Actual Behavior:
Exported variable
EnvConfigApi
has or is using nameExtendedSchemaObject
from external module "node_modules/.pnpm/nestjs-zod@2.3.3_@nestjs+common@10.0.0_@nestjs+core@10.0.0_@nestjs+swagger@7.1.8_zod@3.22.0/node_modules/nestjs-zod/dist/index" but cannot be named.Proposed Solution:
The interface
ExtendedSchemaObject
should be included in the module's exports.This resolves the issue.
The text was updated successfully, but these errors were encountered: