All Questions
68
questions
8
votes
2
answers
3k
views
How to run NestJs app in Docker using nx/monorepo
I have this Nrwl monorepo with a couple of apps. One of it is a NestJs app, which runs fine as long as I do everything inside my Monorepo.
However, I need to run my NestJS app inside a Docker ...
8
votes
1
answer
2k
views
webpack not bundling packages in monorepo (turborepo) then throws "unexpected token 'export'"
EDIT: Repository where issue can be reproduced easily:
https://github.com/sebastiangug/turborepo-nestjs
I have a turborepo project with several nestjs applications that share various packages.
I've ...
8
votes
3
answers
2k
views
Compiling code from another workspace project in a nestjs api - Unexpected token 'export'
I'm trying to create a monorepo containing a NestJs API, a React app, and many other smaller projects shared between them
The monorepo is set up with yarn workspaces
The React app using Vite imports ...
7
votes
2
answers
8k
views
How to use monorepo packages with nestjs using turborepo?
Here's what a real simple monorepo with nestjs using turborepo looks like:
.
├── README.md
├── apps
│ └── nest
│ ├── README.md
│ ├── nest-cli.json
│ ├── package.json
│ ├── ...
6
votes
3
answers
7k
views
TypeORM migration with nx-Monorepo Issue
I tried this a lot but now I think I need some help.
I have a nx-monorepo with angular-frontend and nestjs backend. Now I added a Postgres-SQL database with TypeORM. Everything is working fine, ...
6
votes
2
answers
3k
views
How to do code sharing in NestJS through Yarn Workspaces
I'm trying to do a proof of concept for a simple monorepo application. I decided to just use Yarn Workspaces (I think Lerna maybe here is overkill) to set up my package architecture.
I have a shared ...
4
votes
2
answers
2k
views
NX Monorepo (NestJS/Angular)
I'd like to create a monorepo to manage a fullstack application with a NestJS backend and an Angular frontend that share a package called "shared".
I'd like to do this using NX.
Actually I ...
4
votes
1
answer
3k
views
How to create a shared package in a Turborepo (monorepo), for prisma generated models and types?
I am creating a monorepo using Turborepo consisting of multiple Nestjs microservices, and an API gateway to act as the request distributer. In each microservice, Postgres is used as a database and ...
4
votes
1
answer
465
views
How to run a Nestjs Monorepo on Google App Engine?
I have a vanilla nestjs monorepo that I am failing to run on Google App Engine. We first have to deploy a default service on GAE which I have attempted to do by taking the default nest app (my-app) in ...
4
votes
1
answer
1k
views
run nestjs application with yarn berry workspace monorepo
I want to configure monorepo with yarn berry workspaces.
I create nest application with cli that nest g application . in packages/mono-api-server folder
here is my file tree
.
├── .pnp.cjs
├── .pnp....
3
votes
3
answers
2k
views
How do I generate a NestJS resource in an app within an Nx workspace using the nx cli?
I want to generate a NestJS resource in my new nestjs app within an Nx workspace, similar to the way you would in a solo NextJS app using the nest generate cli command. Using the nx generate command I ...
2
votes
1
answer
6k
views
Problem with launching application in NX monorepo: (cannot read undefined (reading 'projects')
I had one project (grocery-shop) in NX monorepo that uses nestjs among others. The application is a strict backend api. I wanted to add a frontend and for this purpose I dragged react to the project. ...
2
votes
1
answer
1k
views
Cannot use TypeOrm in nx-nestjs project: ERR_REQUIRE_ESM
I am migrating my NestJS-TypeOrm app to a monorepo (NX workspace).
Whenever I try to run the app, I get this error:
C:\myproject\node_modules\@nrwl\node\src\executors\node\node-with-require-overrides....
2
votes
2
answers
2k
views
Jest tests fail after using 'csv-parse/sync' lirbary
I am using NestJs with Nx.dev for monorepo. After I installed csv-parse/sync and used my Jest tests don't work anymore.
Jest encountered an unexpected token
Jest failed to parse a file. This happens ...
2
votes
1
answer
5k
views
How to build a NestJs api from a mono repository
I am working on a project where we are storing our code in a monorepo that is "managed" by nrwl. The repo contains a couple angular apps and a couple nestjs apis.
Now we want to dockerize the apis to ...
2
votes
1
answer
3k
views
Why my build version of NestJS for production inside nx monorepo does not include database?
I created an nx monorepo (Angular + NestJS) with mysql database. Each time I build it for production using npx nx build or npx nx run api:build:production, I see success message (NX SUCCESS Running ...
2
votes
1
answer
598
views
NestJS Monorepo Microservices Deployment to Heroku with Shared Files
Currently, I am building a monorepo microservices with an apigateway using Redis to communicate. I am planning to deploy each services into different dynos in Heroku. Currently, it's pretty ...
2
votes
2
answers
1k
views
"Single source of truth" schema/validation class for server (NestJs/GraphQL/TypeGraphQL/Prisma) and client (NextJs)
I'm building an Typescript application using an NX monorepo, NestJs/GraphQL/TypeGraphQL (built into @nestjs/graphql)/Prisma/PostgreSQL on the server, and NextJs on the client.
With this stack (when ...
2
votes
1
answer
774
views
Nestjs getting @types/react errors in monorepo
I am working with a monorepo using Yarn workpaces work my backend (using Nestjs) and my current frontend (CRA using Tailwind, I will also add a React Native app in the future), I managed to fix some ...
2
votes
1
answer
2k
views
NestJs monorepo shared lib injection
I have NestJS application with couple microservices stored in single repository (monorepo approach).
AccessControl module stores in libs, it should be shared across multiple microservices. It has ...
2
votes
0
answers
1k
views
Dockerize a monorepo - node, react, nestjs and workspaces
I'm just starting to get into docker and I want to setup a monorepo with workspaces which I can use as a base for new development ideas of mine.
So I already setup a working monorepo with node, react, ...
2
votes
0
answers
377
views
How to generate openapi json with NX?
I am having NestJS projects in a Monorepo and NX is our build system.
I am looking for a way to compile and run a TS file at build time. The TS file has a logic to generate openapi.json file. TS file ...
2
votes
0
answers
1k
views
Typeorm is not generating entities on build when using NX
I'm using nx for a project and Have a NestJS API with Typeorm but when running nx serve app the entities files are not being generated so I get this error when trying to insert data to the database.
...
2
votes
3
answers
4k
views
TypeORM - Running a migration with custom schema
I need to run TypeORM migration that creates bunch of tables. MS-SQL Database is already created. Those tables are part of schema domain1. Here's the ORM config and migration.
config
return {
type: ...
2
votes
1
answer
4k
views
Nestjs monorepo with relative environment variables in docker-compose
I am creating Nestjs based microservices & used nestjs cli to create monorepo. After creating monorepo, I created Dockerfile and docker-compose files both in root path of project. Then I created ....
2
votes
1
answer
2k
views
Conceptual Question: Shared GraphQL schema for multiple endpoints (client/admin)
Context
I am using a NX Workspace to organize two different angular frontends (client & admin). To separate client and admin logic, two different NestJS backend services including GraphQL are used ...
1
vote
1
answer
778
views
Is Nest JS Microservice really a microservice?
I was wondering if we can build microservices application using Nest JS with separate repositories. All of the docs in Nest JS regarding microservices only support monorepo style and single database.
...
1
vote
1
answer
140
views
nx 15 , nx 16 with nestjs cannot be inspected in Chrome in Ubuntu 22.04
I have created a simple nest application with nx.
By following their official tutorial at: https://nx.dev/recipes/getting-started/set-up-a-new-workspace
I used npx create-nx-workspace@15 to create a ...
1
vote
1
answer
1k
views
NestJS Monorepo project - Can I build a library separate?
I have a NestJS Monorepo app I created using the nest CLI. Its a main app and I created a library called "common".
I would like to package the library up and distribute it within my company ...
1
vote
1
answer
825
views
How to use DTOs classes from another package for validation in NestJS?
I'm trying to use NestJS's ValidationPipe to validate DTOs that are passed to my controllers. In my DTOs I use TypeScript decorators inside ES 6 classes, as recommended by the official docs.
While ...
1
vote
1
answer
2k
views
nrwl/nx monrepo nestjs build error Cannot find module '@nestjs/common'
I'm using nrwl/nx monorepo in project angular as frontend and nestjs as backend api. when I'm trying to make a build os both apps angular build up and running successfully when I'm starting the nestjs ...
1
vote
0
answers
61
views
Nest JS in a monorepo can't find main module
I have a monorepo setup with turborepo that includes a commons library with shared code, a react web app and and NestJS app.
My NestJS app use some code from the library and I added paths in the ...
1
vote
0
answers
141
views
How to remove build warnings from Angular when adding path to tsconfig compilerOptions?
I have a monorepo with an Angular 16 application and a NestJS backend. I need them to share some things like enums and interfaces, so I am following this guide which has been helpful.
My folder ...
1
vote
0
answers
79
views
NestJs monorepo with independently versioned artefacts
NestJs tooling supports monorepos and it works ok, but it uses a single package.json on the root level, for the whole set of projects. I haven't found support for the following two related questions:
...
1
vote
1
answer
539
views
New Relic Logging is not working nest js monorep
I'm integrating New Relic into my Nest.js monorepo application for monitoring. I've successfully set up the New Relic agent, and it's tracking the application's traffic. However, I'm facing an issue ...
1
vote
1
answer
2k
views
ERROR [I18nService] parsing translation error Error: ENOENT: no such file or directory, stat using | monorepo | nx | nestjs
I have a problem about using i18n with Nest.js with mono repo(nx). I tried so much things but I can't solve the problem. Compiler is not export the i18n folder to dist directory. I am sharing some ...
1
vote
1
answer
2k
views
Design structure for nextjs and nestjs inside nx monorepo with pnpm
I am planning to nextjs app on frontend and nestjs for backend inside NX monorepo using pnpm workspace.
I am confused how should I design the complete folder structure.
Should I use package based ...
1
vote
1
answer
198
views
monorepo updating one nestjs app from nestjs v7 to v8
hello guys I have a monorepo that has 2 microservices
microservice 1(nestjs@v7)
microservice 2 (nestjs@v7)
and a shared packege
shared package that use (nestjs@v7)
both of the microservices use ...
1
vote
1
answer
753
views
Monorepo Vue + Nestjs domain and platform object sharing
Objective:
Use a monorepo structure, in which I can share domain models and generic implementations (using a provider pattern) across the different Bounded Contexts
Ability to deploy each bounded ...
1
vote
0
answers
1k
views
Docker container slow to start monorepo apps
When I run docker-compose to build a monorepo of Angular and Nest applications through NX, the build is fast but the containers run really slowly. But if I run those applications straight on my mac, ...
0
votes
1
answer
755
views
How to use NX DTO libraries decorated with NestJS swagger api in frontend frameworks
I have a nestjs dto in my NX project library declared like following:
import { ApiProperty } from '@nestjs/swagger';
import { MinLength, MaxLength, IsNotEmpty, IsEmail } from 'class-validator';
class ...
0
votes
1
answer
2k
views
How to share classes between different apps in a nestjs monorepo?
I have this piece of structure in my nestjs monorepo:
apps
|-project1
|-src
|-admin
|-dtos (class 1, class2... index.ts)
|-project2
|-src
|-user
|-class 3 (import {class1} from ...
0
votes
1
answer
2k
views
How to change NestJS Decorator string parameter when importing library
I have a NestJs monorepo with some Apps (microservices) and Libs.
I have a Service class that I use in all my apps, so I wanted to extract it in a lib.
I thought it's good idea, but then I realized, I ...
0
votes
2
answers
314
views
No metadata for "LookupType" was found. EntityMetadataNotFoundError: No metadata for "LookupType" was found
I am trying to create a backend using NestJS with nx mono repo and I am getting this error
No metadata for "LookupType" was found. EntityMetadataNotFoundError: No metadata for "...
0
votes
1
answer
157
views
Microservices autorization issue(passport js)
I recently started a course on microservices and ran into a problem with the application of the passport. The problem is that my strategy apparently does not see my token and does not call the ...
0
votes
1
answer
1k
views
NX recompile error: Starting inspector on localhost:9229 failed: address already in use
I am using NX for monorepo project together with NestJs. After i run project everything works fien until I do some changes in files and save them. After webapck recompiles project it shows that it is ...
0
votes
0
answers
46
views
TypeScript: Exported types incomplete when using Prisma methods in TurboRepo
I'm encountering a TypeScript type inference issue in my TurboRepo setup, specifically when using Prisma methods within NestJS services. In the server package, I have an export.d.ts file that exports ...
0
votes
0
answers
54
views
SyntaxError: Unexpected token 'export' in typescript monorepo project
I am working on a microservice application with Nest.js in a pnpm monorepo workspace. I have a type package where I defined all the types of my project.
When I try to use a type in my services, an ...
0
votes
0
answers
34
views
NestJS monorepo can't find processor file
I am using NestJS in a mono repo currently. One of the job queues is pointing to a file to leverage using a seperate process for that job. When running the build, the output is a single file in dist/...
0
votes
0
answers
210
views
Admin.js + Nest.js monorepo (ESM and CJS)
I want to create a mono repo with 3 folders:
adminjs
api
shared
Adminjs, created with adminjs create (v7 on nest.js). As written in their documents, it only supports ESM.
The api is a simple nest ...