0

I tried to fork a simple pino transport "pino-loki" on github and wan't to add it as my dependency. package.json seems to be fine and the library is pulled from github.

"pino-loki": "mygithub/pino-loki"

But for some reason pino can't initialise this transporter.

{
    target: 'pino-loki',
    level:"info",
    options: {
        host: 'http://localhost:3100',
        batching: true,
        interval: 5,
    }
},

Error: unable to determine transport target for "pino-loki"

I can see it in my node_modules, are there any additional steps I'm missing?

somerandomusername
  • 1,993
  • 4
  • 23
  • 55

1 Answers1

0

I had a similar problem with pino-mongodb and SvelteKit. It worked ok in dev, but I had the same "unable to determine transport target for" error once it was deployed to Vercel.

My solution was to add the following line at the top of the file where I'm initialising the logger:

import 'pino-mongodb';

See a similar SO post here pino-datadog-transport with Next.js on Vercel

Benjineer
  • 1,530
  • 18
  • 22