If you’re using Nest v8, RxJS version 7 is used, which no longer has a toPromise()
method for Observables, so Nest uses the lastValueFrom
method instead. If you’re receiving this error, you probably need to update your rxjs
dependency to >7.
npm i rxjs@^7
yarn add rxjs@^7
pnpm i rxjs @^7
Pick your flavor of package manager and have at it.
In the last update of NestJS, when is used cli to initialization of project this error is throw.