Closed Unga closed 2 years ago
Have you tried adding pino-pretty as a runtime dependency if you are using it?
Have you tried adding pino-pretty as a runtime dependency if you are using it?
Yep. Installed "npm i pino pino-pretty"
It looks like issue is not with dependencies but with import on the fly
wonder if bundler is not picking it up due to dynamic import. can you somehow force dependency bundling?
wonder if bundler is not picking it up due to dynamic import. can you somehow force dependency bundling?
Yesterday I switched our project from Winston to Pino because Winston has same issue... I decided to try something new :) But when I added pino-pretty to config I got same issue. What do you mean "force dependency bundling"?
Check if esbuild supports manually specifying which dependencies to include.
Check if esbuild supports manually specifying which dependencies to include.
I want to bundle everything to one file. I don't want to setup anything as external dependencies Did not find solution yet :(
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hi,
I packed project with esbuild (output is one file index.js). Configuration of Pino transport:
transport: { target: 'pino-pretty', options: { colorize: true, ignore: 'time,pid,hostname', }, },
On runtime I receive next error: node:internal/modules/cjs/loader:930 throw err; ^ Error: Cannot find module 'pino-pretty' Require stack: /Users/d/test/index.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:15) at Function.resolve (node:internal/modules/cjs/helpers:99:19) at fixTarget (/Users/d/test/index.js:36543:34) at transport (/Users/d/test/index.js:36534:26) at normalizeArgs (/Users/d/test/index.js:41495:20) at Object.pino [as default] (/Users/d/test/index.js:42270:32) ...
Code (row 36543) from my packed index.js: ` function fixTarget(origin) {
}`
Any ideas what to do? Thanks