-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using type enum from third party imported npm package causes "is not defined by 'exports'" #2087
Comments
I found out that the nestjs/swagger cli plugin causes the problem. If I remove the plugin it works as expected. |
Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project). |
Having the same issue |
Im experiencing the same issue when using monorepo and importing DTOs from shared packages. For the DTOs i found a workaround. instead import { barDto } from '@shared/dtos'
export class fooDto {
bar: barDto;
} you can create new empty class in your app and just extend from original DTO import { barDto as barDtoExternal } from '@shared/dtos'
class barDto extends barDtoExternal {}
export class fooDto {
bar: barDto;
} |
Did anyone solved this issue? I'm having the same problem with shared enums... |
I also encountered similar problem, im my case the package path is absolute path. I move the project to a none unicode character path and it work. |
@kamilmysliwiec the description has a stackblitz and this is still an issue. |
Let's track this here #3029 |
Is there an existing issue for this?
Current behavior
I have a simple nestjs dto class importing an enum type from a third party npm package.
In the @company/common modul the enum is exported as follows:
running the app cause the following error:
If I change the type of the property to
string
and keep the import the app start successfully. If I use the enum not in *.dto files the enum works fine.Steps to reproduce
https://stackblitz.com/edit/nestjs-typescript-starter-bbgorc?file=package.json,src%2Fmain.ts,nest-cli.json,src%2Fdtos%2Fcats.dto.ts,src%2Fapp.controller.ts,src%2Fapp.service.ts
Expected behavior
APP runs with imported enum from third party npm package.
Package version
6.0.5
NestJS version
9.0.9
Node.js version
16.14.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: