Hello World...

Nest.js v10 , 클라우드타입 배포시 prisma/error 본문

카테고리 없음

Nest.js v10 , 클라우드타입 배포시 prisma/error

FaustK 2023. 9. 23. 22:55

로컬에서는 문제 없이 작동했지만, 

nest.js 를 클라우드타입에 배포하게 되면 아래와 같은 에러가 발생하면서 빌드 및 실행이 제대로 되지 않았다.

 

Module '"@prisma/client"' has no exported member ...

 

 

아래와 같이 빌드할 때 명령어를 추가해 주었지만 해결이 되지 않았다.

"build": "npx prisma generate & nest build",

 

구글링을 하다가 아래와 같은 해결책을 찾아 적용하니 빌드 및 실행이 성공적으로 진행되었다.

https://github.com/prisma/prisma/issues/13672

 

Module '"@prisma/client"' has no exported member 'PrismaClient'.ts(2305) · Issue #13672 · prisma/prisma

Bug description I tried to use pnpm in my proj but it seems it does not work I see this two issues too but none of them helped: #2584 #7484 How to reproduce Clone the repo: https://github.com/kasir...

github.com

 

아래와 같이 output 을 명시하니 성공 

generator client {
  provider = "prisma-client-js"
  output   = "../node_modules/.prisma/client"
}

뭔가 제대로 생성이 안 되어서 그런 것 같기도 하고 정확하게 원인을 모르겠다.

output 을 명시하니 node_modules 에 .prisma 폴더가 생성되었다.

default output 이 제대로 작동을 안 한 것일까? 위치를 제대로 찾지 못해서...

 

https://www.prisma.io/docs/concepts/components/prisma-client/working-with-prismaclient/generating-prisma-client#why-is-prisma-client-generated-into-node_modulesprismaclient-by-default

 

Generating Prisma Client (Concepts)

This page explains how to generate Prisma Client. It also provides additional context on the generated client, typical workflows and Node.js configuration.

www.prisma.io

 

 
Comments