Worker pool error: ModuleNotFound resolving "./src/workers/loadEventsWorker.ts"
Updating to 2.6.0 and running on Windows 11 Pro results in many similar looking errors as in #32:
...
Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
============================================================
Bun v1.2.19 (aad3abea) Windows x64
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "C:\Users\jthoennes\Downloads\junie-explorer-windows-x64.exe"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch jsc standalone_executable workers_spawned(3297) workers_terminated(3275)
Builtins: "bun:main" "node:async_hooks" "node:buffer" "node:constants" "node:crypto" "node:events" "node:fs" "node:http" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:stream" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads"
Elapsed: 46567ms | User: 72515ms | Sys: 229609ms
RSS: 1.53GB | Peak: 1.67GB | Commit: 3.54GB | Faults: 20584606 | Machine: 68.40GB
panic(thread 79036): Segmentation fault at address 0x4CAFA350110
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.2.19/w_1aad3abegMz/7v//Di3jqGkpqJq0u1Jw/j2J4qs2J8/9+Gggh2Bq5n2B0jp2B42q2BA20sChv/r5F
Interrupting the startup with Ctrl-C crashes Bun.
Running the startup process to the end also results in a crash of Bun, details:
============================================================
Bun v1.2.19 (aad3abea) Windows x64
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "C:\Users\jthoennes\Downloads\junie-explorer-windows-x64.exe"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch jsc standalone_executable workers_spawned(3707) workers_terminated(3683)
Builtins: "bun:main" "node:async_hooks" "node:buffer" "node:constants" "node:crypto" "node:events" "node:fs" "node:http" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:streamWorker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
" "node:tty" "node:urlWorker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
" "node:util" "node:zlib" "node:worker_threads"
Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
Elapsed: 47518ms | User: 80828ms | Sys: 258390ms
RSS: 1.27GB | Peak: 1.70GB | Commit: 3.59GBWorker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
| Faults: 23072751 | Machine: Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
68.40GB
panic(thread 74860): Segmentation fault at address 0x446742573A0
Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.2.19/w_1aad3abegMz/7v//Dsw44wBg734wBysoJ4ikhF6h7reCYKERNEL32.DLLut0LCSntdll.dll40hPA2skCg651k0D
Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.js\" (entry point)",
error: null,
}
The worker pool errors are mixed with the final crash of bun.
See v2.6.1.
I'd be interested to know whether the workers work without error on Windows, and what the load time is compared to concurrency disabled, but this should provide a workaround to use the old sync code if its still failing.
I think the fundamental problem is that the worker script was specified as a .js file, but was actually a .ts file. I suspect that the module resolution works slightly differently in the Windows binary and this prevented it from resolving the file.
I elected to change the worker logic so that you can disable workers and use the original promise based code. Set the CONCURRENCY=0 environment variable, e.g.
CONCURRENCY=0 ./junie-explorer-apple-arm64
For Windows command line, I think this should be:
set CONCURRENCY=0 && ./junie-explorer-windows-x64
One downside of disabling the concurrency is that it no longer shows the load progress as it reads each directory. This appears to be an issue of how many promises get created and how that interacts with the console.log output. Likely something to do with macrotask and micro task resolution in the run loop.
After the initial "Reading logs, please wait..." message, you'll not see any output until its done, when all the log messages come at the same time. I tried plenty of refactoring but couldn't resolve this, at least for my logs. Smaller log sets might behave differently.
Many thanks for the updates!
Disabling CONCURRENCY worked for Windows 11. Loaded in 93 seconds.
Increasing concurrency to just 1 crashes Bun:
...
Worker pool error: ErrorEvent {
type: "error",
message: "BuildMessage: ModuleNotFound resolving \"./src/workers/loadEventsWorker.ts\" (entry point)",
error: null,
}
============================================================
Bun v1.2.19 (aad3abea) Windows x64
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "C:\Users\jthoennes\Downloads\junie-explorer-windows-x64.exe"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch jsc standalone_executable workers_spawned(237) workers_terminated(236)
Builtins: "bun:main" "node:async_hooks" "node:buffer" "node:constants" "node:crypto" "node:events" "node:fs" "node:http" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:stream" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads"
Elapsed: 10589ms | User: 5375ms | Sys: 5421ms
RSS: 0.37GB | Peak: 0.43GB | Commit: 0.56GB | Faults: 1684126 | Machine: 68.40GB
panic(thread 77284): Segmentation fault at address 0x27AE1700770
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.2.19/w_1aad3abegMz/7v//Dsw44wBg734wBysoJ4ikhF6h7reCYKERNEL32.DLLut0LCSntdll.dll40hPA20nBhp8/xe
Reported as also failing in the same way in the Apple Arm64 binary, which works fine on my own system.
Should be fixed in https://github.com/dmeehan1968/junie-explorer/releases/tag/v3.5.0