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

The output of webpack using this plugin it is correct only when build on Linux. #157

Open
fbeqirllari opened this issue Mar 22, 2024 · 7 comments

Comments

@fbeqirllari
Copy link

When i execute build on Windows doesn't work, but in linux works.

@simoneb
Copy link
Collaborator

simoneb commented Mar 22, 2024

As you can see, CI is running successfully on both Linux and Windows. https://github.com/pinojs/pino-webpack-plugin/actions/runs/6721201099

@simoneb simoneb closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2024
@fbeqirllari
Copy link
Author

The output when building using webpack on Linux

 globalThis.__bundlerPathsOverrides = {
'pino/file': pinoWebpackAbsolutePath('./pino-file.js'),
'pino-worker': pinoWebpackAbsolutePath('./pino-worker.js'),
'pino-pipeline-worker': pinoWebpackAbsolutePath('./pino-pipeline-worker.js'),
'pino-socket': pinoWebpackAbsolutePath('./pino-socket.js'),
'pino-pretty': pinoWebpackAbsolutePath('./pino-pretty.js'),
'thread-stream-worker': pinoWebpackAbsolutePath('./thread-stream-worker.js')};

The output when building using webpack on Windows

globalThis.__bundlerPathsOverrides = {
'pino/file': pinoWebpackAbsolutePath('.\pino-file.js'),
'pino-worker': pinoWebpackAbsolutePath('.\pino-worker.js'),
'pino-pipeline-worker': pinoWebpackAbsolutePath('.\pino-pipeline-worker.js'),
'pino-pretty': pinoWebpackAbsolutePath('.\pino-pretty.js'),
'pino-socket': pinoWebpackAbsolutePath('.\pino-socket.js'),
'thread-stream-worker': pinoWebpackAbsolutePath('.\thread-stream-worker.js')
};

@simoneb
Copy link
Collaborator

simoneb commented Mar 22, 2024

that looks like an issue, yes, as the path separator should be escaped

@simoneb simoneb reopened this Mar 22, 2024
@fbeqirllari
Copy link
Author

The error i get when i build on Windows and i run it is:
Error: Cannot find module 'C:\Users\**\dist\. hread-stream-worker.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15) at Module._load (node:internal/modules/cjs/loader:985:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) at MessagePort.<anonymous> (node:internal/main/worker_thread:186:26) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20) at exports.emitMessage (node:internal/per_context/messageport:23:28) { code: 'MODULE_NOT_FOUND', requireStack: [] }

@fbeqirllari fbeqirllari changed the title This plugin works only on linux machines The output of webpack using this plugin it is correct only when build on Linux. Mar 22, 2024
@simoneb
Copy link
Collaborator

simoneb commented Mar 22, 2024

it looks like our tests are not covering this then. yes the paths are wrong because we're escaping them. it should be a pretty obvious issue to spot in the codebase, would you like to give it a go?

@fbeqirllari
Copy link
Author

it looks like our tests are not covering this then. yes the paths are wrong because we're escaping them. it should be a pretty obvious issue to spot in the codebase, would you like to give it a go?

index.js file is different from the main branch and release code? It looks like in the main branch is fixed already.

@simoneb
Copy link
Collaborator

simoneb commented Apr 15, 2024

Maybe it just needs somebody to do a release then

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

No branches or pull requests

2 participants