#TypeError: Cannot set properties of null (setting 'context')

1 messages · Page 1 of 1 (latest)

tidal dust
#

it seems i have a issue with the ogma service
TypeError: Cannot set properties of null (setting 'context')
can't really explain this one

C:\Users\Huizinga\Documents\projects\nest-server\node_modules\@ogma\nestjs-module\src\ogma.service.js:76
            meta.context = context;
                         ^
TypeError: Cannot set properties of null (setting 'context')
    at OgmaService.error (C:\Users\Huizinga\Documents\projects\nest-server\node_modules\@ogma\nestjs-module\src\ogma.service.js:76:26)
    at Logger.error (C:\Users\Huizinga\Documents\projects\nest-server\node_modules\@nestjs\common\services\logger.service.js:43:29)
    at C:\Users\Huizinga\Documents\projects\nest-server\node_modules\@nestjs\common\services\logger.service.js:98:45
    at Array.forEach (<anonymous>)
    at Function.flush (C:\Users\Huizinga\Documents\projects\nest-server\node_modules\@nestjs\common\services\logger.service.js:98:24)
    at NestApplication.flushLogs (C:\Users\Huizinga\Documents\projects\nest-server\node_modules\@nestjs\core\nest-application-context.js:132:25)
    at Server.<anonymous> (C:\Users\Huizinga\Documents\projects\nest-server\node_modules\@nestjs\core\nest-application.js:182:26)
    at Object.onceWrapper (node:events:628:28)
    at Server.emit (node:events:514:28)
    at emitListeningNT (node:net:1906:10)
tidal pebble
#

I'm gonna need to see some sort of code for this

tidal dust
tidal pebble
#

Probably your configuration, and context around what you're doing to get this error

tidal dust
# tidal pebble Probably your configuration, and context around what you're doing to get this er...
OgmaModule.forRootAsync({
      inject: [ApiConfigService],
      useFactory: (config: ApiConfigService) => ({
        json: false,
        color: true,
        logLevel: 'ALL',
        application: 'NestJS',
        stream: {
          write: (message: string) => {
            if (config.isDev) {
              process.stdout.write(message)
            } else {
              appendFile(config.log.dir, message, (err) => {
                if (err) {
                  throw err
                }
                return true
              })
            }
          },
        },
      }),
    }),

ofc the ExpressParser and OgmaInterceptor are also there
have been switching orm the last few days from prisma to typeorm because it would give me more control

#

anything else?

tidal pebble
#

What are you doing when you get this error?

tidal dust
tidal pebble
#

What logs are you calling?

#

Can you provide a way to reproduce this?

tidal dust
tidal dust
tidal pebble
#

I'm just trying to figure out how this is happening in the first place\

tidal dust
#

great...

#

or rather a 1 time error
rebooted nest 3 times now without issue

tidal pebble
#

🤷‍♂️

tidal dust
#

yeah that's what i think as well

#

i will keep this post open for a few days to see if anything comes up

#

otherwise i will close it, thx i gues?
idk anymore 😭