Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to determine transport target for "pino-mongodb" #122

Open
toto1384 opened this issue Oct 14, 2022 · 1 comment
Open

unable to determine transport target for "pino-mongodb" #122

toto1384 opened this issue Oct 14, 2022 · 1 comment

Comments

@toto1384
Copy link

The pino-mongodb library is installed

Here is the code

import pino from 'pino'
const transport = pino.transport({
	target: 'pino-mongodb',
	/* level: 'info', */
	options: {
		uri: `${(process.env.MONGODB_CONNECTION as string).split('27017')[0]}27017`,
		database: 'logs',
		collection: 'main',
		mongoOptions: {
			auth: {
				username: logins[0],
				password: logins[1]
			}
		}
	}
})

const logger = pino(transport)

Here is the error I am getting

error - Error: unable to determine transport target for "pino-mongodb"
    at fixTarget (/Users/alex/Mynextjob/CODE/complete/node_modules/.pnpm/pino@8.6.1/node_modules/pino/lib/transport.js:136:13)
    at Function.transport (/Users/alex/Mynextjob/CODE/complete/node_modules/.pnpm/pino@8.6.1/node_modules/pino/lib/transport.js:110:22)
    at eval (webpack-internal:///./utils/backend/backendMain.ts:116:63)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  page: '/'
}
@mcollina
Copy link
Member

It seems you are running webpack without the additional config for transports.

https://github.com/pinojs/pino-webpack-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants