Skip to content

Commit 94d2f17

Browse files
committed
fix: update initPinoLogger method to use async/await for dynamic import of Pino for ESM compatibility
1 parent 0a71f10 commit 94d2f17

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/core/src/logger.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ export class ObjectLogger implements Logger {
4949
/**
5050
* Initialize Pino logger for Node.js
5151
*/
52-
private initPinoLogger() {
52+
private async initPinoLogger() {
5353
if (!this.isNode) return;
5454

5555
try {
5656
// Dynamic import for Pino (Node.js only)
57-
const pino = require('pino');
57+
// Use dynamic import for ESM compatibility
58+
const pinoModule = await import('pino');
59+
const pino = pinoModule.default || pinoModule;
5860

5961
// Build Pino options
6062
const pinoOptions: any = {

0 commit comments

Comments
 (0)