#How do I run nest in debug mode without the cli?

1 messages · Page 1 of 1 (latest)

hazy scarab
#

Trying to debug an error with ScheduleModule but I'm using ts-node (specificially the esm binary) to start my app. I created a bare bone repro but the issue isn't happening there so I need to debug it here

rare aspen
#

Should just need node's standard debug flags. --inspect-brk I think

hazy scarab
#

theres a way to get more verbose logs on startup isn't there?

#

I'm getting this error

Nest can't resolve dependencies of the SchedulerMetadataAccessor (?). Please make sure that the argument Reflector at index [0] is available in the ScheduleModule context.
#

and I assume its something to do w node_modules

#

because it doesn't work on the repo i want it to work on

#

but it works in clean repo

#

and it also works on the same repo on my laptop

rare aspen
#

Oh, NEST_DEBUG, the env variable, needs to be truthy

#

That error is usually even multiple versions of @nestjs/common|core|platform-* packages are installed. Or mismatched versions

hazy scarab
#

is there anyway I can tell? I did a quick search and all the versions seem to match

rare aspen
#

Package manager?

hazy scarab
#

pnpm

rare aspen
#

pnpm why @nestjs/common

hazy scarab
#

everything seems to be on the same version

rare aspen
#

Hmm. Is this a monorepo?

hazy scarab
#

yes

rare aspen
#

Monorepo manager?

hazy scarab
#

hmm

#

none

rare aspen
#

Pnpm workspace, nx, turbo, nothing?

hazy scarab
#

pnpm workspace

rare aspen
#

Does everything have its own node_modules or is it all installed in root?

hazy scarab
#

they all have their own node_modules

rare aspen
#

And nest is installed in multiple node_modules?

hazy scarab
#

@rare aspen interestingly enough

#

the issue occurs when two projects in the monorepo are using @nestjs/schedule

#

in response to your question im not sure

#

while yes each project has their own node_modules

#

its still managed by pnpm

#

which just symlinks the node_modules folder with only the installed depencneis

#

while at the workspace level is the actual node_modules where all the packages are located

#

i might be able to make a repro

hazy scarab
#

cant repro in a blank app

#

but i know how to cause the error in my app

#

when i included these dependencies in the individual app's package json

 "@nestjs/common": "9.3.9",
    "@nestjs/core": "9.3.9",
    "@nestjs/config": "2.3.1",
    "@nestjs/platform-fastify": "9.3.9",
    "reflect-metadata": "0.1.13",
    "rxjs": "7.8.0"
#

it causes the error

#

but when i remove them and install them at the top level

#

it doesnt

#

its probably just common that needs to be installed top level

#

common or core whichever one has the reflector in it

rare aspen
#

It's an issue of multiple install locations (even if they are sym linked) of the NestJS dependence

hazy scarab
#

how do u fix this in a monorepo

#

if it isnt install at top level

rare aspen
#

It is install at top level of the workspace