redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.28k stars 992 forks source link

v0.47 pino-pretty missing dep #4632

Closed pi0neerpat closed 2 years ago

pi0neerpat commented 2 years ago

pino-pretty was removed in https://github.com/redwoodjs/redwood/releases/tag/v0.47.0 , but is still required

api | Error: Missing `pino-pretty` module: `pino-pretty` must be installed separately

Solved by installing pino-pretty in api

simoncrypta commented 2 years ago

Hey @pi0neerpat thanks for reporting It's probably cause by some config that require pino-pretty inside api/src/lib/logger.ts Do you have any custom config inside createLogger({}) ?

pi0neerpat commented 2 years ago

I don't remember ever changing from default

import { createLogger } from '@redwoodjs/api/logger'

/**
 * Creates a logger with RedwoodLoggerOptions
 *
 * These extend and override default LoggerOptions,
 * can define a destination like a file or other supported pino log transport stream,
 * and sets whether or not to show the logger configuration settings (defaults to false)
 *
 * @param RedwoodLoggerOptions
 *
 * RedwoodLoggerOptions have
 * @param {options} LoggerOptions - defines how to log, such as pretty printing, redaction, and format
 * @param {string | DestinationStream} destination - defines where to log, such as a transport stream or file
 * @param {boolean} showConfig - whether to display logger configuration on initialization
 */
export const logger = createLogger({
  options: { level: 'info', prettyPrint: true },
})
pi0neerpat commented 2 years ago

I removed prettyPrint: true here and it fixed it. Relevant: https://github.com/pinojs/pino/blob/master/docs/api.md#options