Skip to content

使用 mwtsc 运行会导致 typegoose 的 InjectEntityModel 在有些情况下失效 #3745

Closed Answered by pecasha
pecasha asked this question in Q&A
Discussion options

You must be logged in to vote

我找到原因了,是数据源匹配的问题,src/config 配置文件中的 mongoose.dataSource.default.entities 我原先是配置的:

entities: [
    "**/*.entity.ts"
]

mwtsc是走编译的方式,这样会导致编译后找不到entity文件,只需要把配置改为这样就可以了:

entities: [
    "**/*.entity.{j,t}s"
]

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@czy88840616
Comment options

@czy88840616
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by pecasha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type: question / discussion This issue or pull request need be discussion
3 participants