I get "Can't resolve '_http_common'" when I use NestJS with monorepo (webpack)
See original GitHub issueBug description
When I try to composite Prisma with NestJS monorepo project I get the error. I can`t use default prisma client output path because my projects use prisma client and each project overrides before generated client files. I try to use custom output path but I get the error. I found some information about the error -> https://github.com/restify/node-restify/issues/794.
How to reproduce
Steps to reproduce the behavior:
- Create new app as monorepo project
- Generate client in custom output path. For example “output = …/src/prisma/client”
- Execute command “build”
- See error “Can’t resolve ‘_http_common’”
Expected behavior
Build happy project
Environment & setup
- OS: Mac OS
- Database: PostgreSQL
- Node.js version: 12.22.1
- Prisma version: 2.21.2
datasource db {
provider = "postgresql"
url = env("MAIN_DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
output = "../src/prisma/client"
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:31 (9 by maintainers)
Top Results From Across the Web
Monorepo - CLI | NestJS - A progressive Node.js framework
It automates parts of the build process to make it easy to create and compose modular components, promotes code re-use, makes integration testing...
Read more >Nestjs: Repl with monorepo mode - Stack Overflow
Looking at my dist folder, the only build target is main.js , which would explain it not being able to find the repl...
Read more >Webpack - Serverless Framework: Plugins
A Serverless Framework plugin to build your lambda functions with Webpack. This plugin is for you if you want to use the latest...
Read more >Documentation | NestJS - A progressive Node.js framework
Monorepo's have arisen as a construct to enable that, and within a monorepo, a library provides a way to share code in an...
Read more >API with NestJS #59. Introduction to a monorepo with Lerna ...
This article uses Lerna and Yarn workspaces to manage a monorepo ... and ESlint configuration that we will use in every project we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For me is working to get client generated as below:
Then you can import it from anywhere like:
import {PrismaClient} from '@~internal/prisma'
Hope it helps.
Also sad to report that I didn’t find a workaround other than not upgrading prisma or webpack 😢
But it does look like v4 of unidici is in release candidate stages