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

Does not work with pino v9.1 #157

Closed
viceice opened this issue May 24, 2024 · 4 comments · Fixed by #160
Closed

Does not work with pino v9.1 #157

viceice opened this issue May 24, 2024 · 4 comments · Fixed by #160

Comments

@viceice
Copy link

viceice commented May 24, 2024

> node tools/esbuild.js

X [ERROR] Could not resolve "~\\base\\node_modules\\.pnpm\\[email protected]\\node_modules\\pino\\lib\\worker-pipeline.js"

~\base\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1469
  let error = new Error(text);
              ^

Error: Build failed with 1 error:
error: Could not resolve "~\\base\\node_modules\\.pnpm\\[email protected]\\node_modules\\pino\\lib\\worker-pipeline.js"
    at failureErrorWithLog (~\base\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1469:15)
    at~\base\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:945:25
    at ~\base\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1350:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}
import { build } from 'esbuild';
import esbuildPluginPino from 'esbuild-plugin-pino';

await build({
  entryPoints: { 'cli': './src/cli/index.ts' },
  bundle: true,
  platform: 'node',
  target: `node20`,
  minify: false,
  tsconfig: 'tsconfig.dist.json',
  outdir: './dist',
  plugins: [esbuildPluginPino({ transports: ['pino-pretty'] })],
});

worker-pipeline.js no longer exists

@viceice
Copy link
Author

viceice commented May 24, 2024

@viceice
Copy link
Author

viceice commented May 24, 2024

@viceice
Copy link
Author

viceice commented May 24, 2024

a pnpm patch

diff --git a/dist/index.js b/dist/index.js
index e76d27a89367083f95854fc3b72f8eed88e5a5f6..47c3d5ce5605e02048102a123002d341161017db 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -57,7 +57,6 @@ function esbuildPluginPino({
       const customEntrypoints = {
         "thread-stream-worker": path.join(threadStream, "lib/worker.js"),
         "pino-worker": path.join(pino, "lib/worker.js"),
-        "pino-pipeline-worker": path.join(pino, "lib/worker-pipeline.js"),
         "pino-file": path.join(pino, "file.js")
       };
       const transportsEntrypoints = Object.fromEntries(
diff --git a/dist/index.mjs b/dist/index.mjs
index ffa9c33476053ae103e6c1ca4f42269d1c58f19f..5b9258a6e808c81cac5f374d45343f44a8cbfe2a 100644
--- a/dist/index.mjs
+++ b/dist/index.mjs
@@ -54,7 +54,6 @@ function esbuildPluginPino({
       const customEntrypoints = {
         "thread-stream-worker": path.join(threadStream, "lib/worker.js"),
         "pino-worker": path.join(pino, "lib/worker.js"),
-        "pino-pipeline-worker": path.join(pino, "lib/worker-pipeline.js"),
         "pino-file": path.join(pino, "file.js")
       };
       const transportsEntrypoints = Object.fromEntries(

@segevfiner
Copy link
Contributor

Guess this plugin could receive a PR that checks if worker-pipeline actually exists and doesn't try to bundle it if it doesn't to support newer pino?

segevfiner added a commit to segevfiner/esbuild-plugin-pino that referenced this issue May 29, 2024
wd-David pushed a commit that referenced this issue Jun 9, 2024
* Fix support for Pino v9.1

Fixes #157

* Missing import

* Fix formatting

* Update the tests
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

Successfully merging a pull request may close this issue.

2 participants