repomix: "Not implemented" error when using `bunx`
Description
I use bunx repomix regularly on my Windows computer, but when trying it on my Mac (Apple Silicon M4 chip), I receive an error:
š« ā bunx repomix --verbose
directories: [ '.' ]
cwd: /Users/lance/Programming/project-folder
options: {
fileSummary: true,
directoryStructure: true,
files: true,
gitSortByChanges: true,
gitignore: true,
defaultPatterns: true,
securityCheck: true,
verbose: true
}
š¦ Repomix v0.3.6
Loaded CLI options: {
fileSummary: true,
directoryStructure: true,
files: true,
gitSortByChanges: true,
gitignore: true,
defaultPatterns: true,
securityCheck: true,
verbose: true
}
No Repopack files found to migrate.
Loading local config from: /Users/lance/Programming/project-folder/repomix.config.json
Loading global config from: /Users/lance/.config/repomix/repomix.config.json
No custom config found at repomix.config.json or global config at /Users/lance/.config/repomix/repomix.config.json.
You can add a config file for additional settings. Please check https://github.com/yamadashy/repomix for more information.
Loaded file config: {}
CLI config: {}
Default config: {
input: { maxFileSize: 52428800 },
output: {
filePath: 'repomix-output.xml',
style: 'xml',
parsableStyle: false,
fileSummary: true,
directoryStructure: true,
files: true,
removeComments: false,
removeEmptyLines: false,
compress: false,
topFilesLength: 5,
showLineNumbers: false,
copyToClipboard: false,
git: {
sortByChanges: true,
sortByChangesMaxCommits: 100,
includeDiffs: false
}
},
include: [],
ignore: { useGitignore: true, useDefaultPatterns: true, customPatterns: [] },
security: { enableSecurityCheck: true },
tokenCount: { encoding: 'o200k_base' }
}
Default output file path is set to: repomix-output.xml
Merged config: {
input: { maxFileSize: 52428800 },
output: {
filePath: 'repomix-output.xml',
style: 'xml',
parsableStyle: false,
fileSummary: true,
directoryStructure: true,
files: true,
removeComments: false,
removeEmptyLines: false,
compress: false,
topFilesLength: 5,
showLineNumbers: false,
copyToClipboard: false,
git: {
sortByChanges: true,
sortByChangesMaxCommits: 100,
includeDiffs: false
}
},
include: [],
ignore: { useGitignore: true, useDefaultPatterns: true, customPatterns: [] },
security: { enableSecurityCheck: true },
tokenCount: { encoding: 'o200k_base' },
cwd: '/Users/lance/Programming/project-folder'
}
Adding default ignore patterns
Adding output file to ignore patterns: repomix-output.xml
Adding custom ignore patterns: []
Include patterns: [ '**/*' ]
Ignore patterns: [
'.git/**',
'.hg/**',
'.hgignore',
'.svn/**',
'**/node_modules/**',
'**/bower_components/**',
'**/jspm_packages/**',
'vendor/**',
'**/.bundle/**',
'**/.gradle/**',
'target/**',
'logs/**',
'**/*.log/**',
'**/npm-debug.log*/**',
'**/yarn-debug.log*/**',
'**/yarn-error.log*/**',
'pids/**',
'*.pid',
'*.seed',
'*.pid.lock',
'lib-cov/**',
'coverage/**',
'.nyc_output/**',
'.grunt/**',
'.lock-wscript',
'build/Release/**',
'typings/**',
'**/.npm/**',
'.eslintcache',
'.rollup.cache/**',
'.webpack.cache/**',
'.parcel-cache/**',
'.sass-cache/**',
'*.cache',
'.node_repl_history',
'*.tgz',
'**/.yarn/**',
'**/.yarn-integrity/**',
'.env',
'.next/**',
'.nuxt/**',
'.vuepress/dist/**',
'.serverless/**',
'.fusebox/**',
'.dynamodb/**',
'dist/**',
'**/.DS_Store/**',
'**/Thumbs.db/**',
'.idea/**',
'.vscode/**',
'**/*.swp/**',
'**/*.swo/**',
'**/*.swn/**',
'**/*.bak/**',
'build/**',
'out/**',
'tmp/**',
'temp/**',
'**/repomix-output.*/**',
'**/repopack-output.*/**',
'**/package-lock.json/**',
'**/yarn-error.log/**',
'**/yarn.lock/**',
'**/pnpm-lock.yaml/**',
'**/bun.lockb/**',
'**/bun.lock/**',
'**/__pycache__/**',
'**/*.py[cod]/**',
'**/venv/**',
'**/.venv/**',
'**/.pytest_cache/**',
'**/.mypy_cache/**',
'**/.ipynb_checkpoints/**',
'**/Pipfile.lock/**',
'**/poetry.lock/**',
'**/uv.lock/**',
'**/Cargo.lock/**',
'**/Cargo.toml.orig/**',
'**/target/**',
'**/*.rs.bk/**',
'**/composer.lock/**',
'**/Gemfile.lock/**',
'**/go.sum/**',
'**/mix.lock/**',
'**/stack.yaml.lock/**',
'**/cabal.project.freeze/**',
'repomix-output.xml'
]
Ignore file patterns: [ '**/.gitignore', '**/.repomixignore' ]
Filtered 141 files
Initializing worker pool with min=1, max=2 threads. Worker path: file:///Users/lance/.bun/install/global/node_modules/repomix/lib/core/file/workers/fileCollectWorker.js
ā Unexpected error: Not implemented
Stack trace: Error: Not implemented
at unknown
at new ThreadPool (/Users/lance/.bun/install/global/node_modules/piscina/dist/index.js:95:50)
at new Piscina (/Users/lance/.bun/install/global/node_modules/piscina/dist/index.js:570:57)
at initPiscina (/Users/lance/.bun/install/global/node_modules/repomix/lib/shared/processConcurrency.js:20:16)
at initTaskRunner (/Users/lance/.bun/install/global/node_modules/repomix/lib/core/file/fileCollect.js:14:18)
at <anonymous> (/Users/lance/.bun/install/global/node_modules/repomix/lib/core/file/fileCollect.js:20:26)
at <anonymous> (/Users/lance/.bun/install/global/node_modules/repomix/lib/core/file/fileCollect.js:7:71)
at new Promise (native:1:11)
at __awaiter (/Users/lance/.bun/install/global/node_modules/repomix/lib/core/file/fileCollect.js:3:27)
at map (native:1:11)
Need help?
⢠File an issue on GitHub: https://github.com/yamadashy/repomix/issues
⢠Join our Discord community: https://discord.gg/wNYzTwZFku
I was able to pack successfully using a Docker container as a workaround:
docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix
I am using Bun version 1.2.14 (latest at the time of writing).
Sorry if youāre not intending to support Bun. I have just gotten used to using it as a replacement and wasnāt sure if youād seen this bug before.
Usage Context
Repomix CLI
Repomix Version
v0.3.6
Node.js Version
N/A
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 16 (12 by maintainers)
Hi, @lancegoyke, @gabimoncha !
This issue has been fixed in v1.1.0!
https://github.com/yamadashy/repomix/releases/tag/v1.1.0
Please try:
Weāve migrated from Piscina to Tinypool for worker thread management, which resolves the compatibility issues with Bun.
Thank you for reporting this issue and helping identify the root cause!
Worked for me as well! Nice work!
seems to be working, great job!
@yamadashy the
bin/shebang points to node, so when running the CLI with bun, it will also default with node. try runningbunx --bun repomixor install the library globally using bun. It will be stuck in the āCollecting filesā stepClaude finished @yamadashyās task in 3m 46s āā View job ā¢
claude/issue-591-20250604_155146⢠[Create PR ā](https://github.com/yamadashy/repomix/compare/main...claude/issue-591-20250604_155146?quick_pull=1&title=Issue %23591%3A Changes from Claude&body=This PR addresses issue %23591 Generated with [Claude Code](https%3A%2F%2Fclaude.ai%2Fcode)Root Cause Identified: Bun 1.2.x Breaking Change
Iāve successfully analyzed this issue and identified the exact cause of the āNot implementedā error.
Todo List:
Root Cause Analysis
The Issue: This is a breaking change in Bun 1.2.x where incomplete worker threads support was intentionally removed.
Technical Details:
Why the Error Occurs:
From the stack trace, the error happens when Piscina tries to create worker threads:
This is where Piscina uses Node.js
worker_threadsAPIs that Bun 1.2.14+ explicitly marks as āNot implementedā:worker_threads.WorkerconstructorMessageChannel/MessagePortImpact on Repomix:
Repomix heavily relies on Piscina for parallel processing in multiple places:
src/core/file/fileCollect.ts:10) - Where the error occurs firstsrc/core/security/securityCheck.ts)src/core/metrics/calculateAllFileMetrics.ts)src/core/metrics/calculateOutputMetrics.ts)Since thereās no fallback mechanism in the current codebase, the entire tool fails when worker threads canāt be initialized.
Reproduction Steps
Iāve created a comprehensive reproduction guide at
reproduce-issue.mdwith:Key Commands for Reproduction:
Why It Works on M2 Pro vs Fails on M4
The issue is Bun version, not chip architecture:
Recommended Solutions
Immediate Workarounds (for users):
npx repomixinstead ofbunx repomixLong-term Fix (for repomix maintainers): Add runtime detection and graceful fallback to sequential processing when worker threads arenāt available in
src/shared/processConcurrency.ts.The Docker workaround confirms this analysis - it works because Docker uses Node.js runtime with full worker thread support, not Bun.
Summary
This is a known Bun limitation, not a repomix bug. The error occurs because Bun 1.2+ intentionally removed incomplete worker thread APIs that Piscina depends on. Users should use Node.js (
npx) or Docker until Bun implements complete worker thread support.Cheers! Thanks for your acknowledgement. Iām a bit out of my scope here, but let me know if you think I can help test something in the future.
Hi, @lancegoyke Thank you for the report!
I tried packing Repomix itself with bunx and it seems to work:
Environment:
Iāll dig into this further. Since the error is coming from Piscina (the parallelāprocessing library), it may be something environmentāspecific.