admin管理员组文章数量:1410673
I'm working on a NestJS backend and using Prisma for my database. I generated my Prisma type with the following configuration:
generator clientTypes {
provider = "prisma-client-js"
output = "../ts-rest/types/generated/client"
}
I'm using ts-rest to share the same types between my frontend and backend. I need to import an enum from Prisma like this:
import { CUSTOMER_TYPE } from "ts-rest/types/generated/client";
However, when I try to compile, I get a MODULE_NOT_FOUND error in the file where this import is used. If I change the import path to "@prisma/client", the error is resolved, but I can't use that in my frontend. I use nest start --watch
to compile directly my code.
After some research, I found that the issue occurs because the generated Prisma types are not included in the dist/ts-rest folder after compilation so in the compiled code the type is not present.
Why aren't the Prisma-generated types being copied to the dist folder, and how can I resolve this?
I already tried modifying nest-cli.json, with this:
"compilerOptions": {
"assets": ["ts-rest/types/generated/**/*"]
}
but that didn't fix the issue.
本文标签: nodejsNestJS Prisma Generated Types Not Included in dist folderStack Overflow
版权声明:本文标题:node.js - NestJS Prisma Generated Types Not Included in dist folder - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745067652a2640617.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论