jmcdo29 / ogma

A monorepo for the ogma logger and related packages
https://ogma.jaymcdoniel.dev
MIT License
294 stars 36 forks source link

TypeError `common_1.ConfigurableModuleBuilder is not a constructor` on nest js startup #1373

Closed halconel closed 2 years ago

halconel commented 2 years ago

Briefly

goal was to use ogma in nest js+graphql project

problem I’ve got TypeError common_1.ConfigurableModuleBuilder is not a constructor on nest js startup

Setup

  1. setup ogma logger as shown here: https://github.com/jmcdo29/ogma/tree/main/packages/nestjs-module
  2. using parser as shown here: https://ogma.jaymcdoniel.dev/docs/nestjs/graphql/platform-graphql

Versions

$ yarn list | grep nestjs
├─ @liaoliaots/nestjs-redis@8.2.0
├─ @nestjs/apollo@10.0.11
├─ @nestjs/axios@0.0.8
├─ @nestjs/cli@8.2.5
│  ├─ @nestjs/schematics@^8.0.3
├─ @nestjs/common@8.4.5
├─ @nestjs/config@2.0.0
├─ @nestjs/core@8.4.5
├─ @nestjs/graphql@10.0.11
│  ├─ @nestjs/mapped-types@1.0.1
├─ @nestjs/mapped-types@1.0.1
├─ @nestjs/microservices@8.4.6
├─ @nestjs/platform-express@8.4.5
├─ @nestjs/schematics@8.0.11
├─ @nestjs/terminus@8.0.6
├─ @nestjs/testing@8.4.5
├─ @ogma/nestjs-module@4.0.0
$ y list | grep ogma  
├─ @ogma/nestjs-module@4.0.0
├─ @ogma/platform-express@4.0.0
├─ @ogma/platform-graphql@4.0.0

Error message

TypeError: common_1.ConfigurableModuleBuilder is not a constructor at Object. (/home/dmitriy/workspace/oneclick/looky-api-gateway/node_modules/@ogma/nestjs-module/src/ogma-core.module-definition.js:6:6) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:827:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (/home/dmitriy/workspace/oneclick/looky-api-gateway/node_modules/@ogma/nestjs-module/src/ogma.constants.js:5:39) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)

jmcdo29 commented 2 years ago

@ogma/nestjs-module v4 uses @nestjs/common and @nestjs/core version 9, as the peerDependencies mention and as the changeling says.

halconel commented 2 years ago

Is there a version of @ogma/nestjs-module which works with @nestjs/core 8.4.5?

jmcdo29 commented 2 years ago

@ogma/nestjs-module@^3 along with @ogma/platform-*@^3