#pnpm link issue with NestJs Core

8 messages · Page 1 of 1 (latest)

devout gazelle
#

Hi Guys,

We are building an application framework which sits on top of NestJS and is the middle layer between NestJS and our client applications, the idea is we can import modules into the client app for rapid development.

You can see the monorepo framework starting to be built out here: https://github.com/juicyllama/framework

The problem is we want to pnpm link the modules in this framework to our client applications so we can develop both simultaneously and we don't need to keep building and moving packages across.

However as this thread (https://stackoverflow.com/questions/71272072/nestjs-nest-cant-resolve-dependencies-when-using-npm-yarn-link) comments, Nest seems to throw errors when it happens.

It's not very clear to me how to resolve this as part of our architecture.

It might be worth me spinning up an example client repo so you can see how the framework is being consumed. Hope this makes sense, any suggestions on where to focus would be appreciated.

vernal blaze
#

@devout gazelle - How about using a pnpm workspace or a full-fledged monorepo system like Nx or Rush?

devout gazelle
#

@vernal blaze yes we are using workspaces already, the issue happens when we try to link from our client application to the monorepo packages

vernal blaze
#

What exactly are you linking?

#

Rereading, you are trying to link in Nest modules into a client app?

#

And aside from that, isn't your client app in the monorepo too?

devout gazelle
#

Sorry for the confusion, I’ll create a example client app to demonstrate. Client apps are not in the monorepo as our framework monorepo is open source and we need to keep our client projects private

vernal blaze
#

Interesting. Usually its the other way around. 😄