pinojs / pino-webpack-plugin

MIT License
19 stars 9 forks source link

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

Open fbeqirllari opened 7 months ago

fbeqirllari commented 7 months ago

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

simoneb commented 7 months ago

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

fbeqirllari commented 7 months ago

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 commented 7 months ago

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

fbeqirllari commented 7 months ago

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: [] }

simoneb commented 7 months ago

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 commented 6 months ago

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 commented 6 months ago

Maybe it just needs somebody to do a release then