-
Notifications
You must be signed in to change notification settings - Fork 896
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
Runtime issue (packed by esbuild): Cannot find module 'pino-pretty' #1164
Comments
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? |
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. |
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 |
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
The text was updated successfully, but these errors were encountered: