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)

Most upvoted comments

Hi, @lancegoyke, @gabimoncha !

This issue has been fixed in v1.1.0!

https://github.com/yamadashy/repomix/releases/tag/v1.1.0

Please try:

bunx repomix@latest

# Or
bunx --bun repomix@latest

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!

Hi, @lancegoyke Thank you for the report!

I tried packing Repomix itself with bunx and it seems to work:

bunx repomix

Environment:

bun 1.1.39 Apple M2 Pro macOS Sonoma 14.4.1

I’ll dig into this further. Since the error is coming from Piscina (the parallel‐processing library), it may be something environment‐specific.

@yamadashy the bin/ shebang points to node, so when running the CLI with bun, it will also default with node. try running bunx --bun repomix or install the library globally using bun. It will be stuck in the ā€œCollecting filesā€ step

Image

Claude 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:

  • Examine current worker thread usage in repomix codebase
  • Research Bun version differences between 1.1.39 (working) and 1.2.14 (failing)
  • Analyze Piscina dependency requirements
  • Identify the root cause of the compatibility issue
  • Provide reproduction steps and potential solutions

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:

  1. Bun 1.1.39 (Working on M2 Pro): Had experimental/partial worker threads implementation
  2. Bun 1.2.14 (Failing on M4): Breaking change - Bun now throws ā€œNot implementedā€ instead of providing broken functionality

Why the Error Occurs:

From the stack trace, the error happens when Piscina tries to create worker threads:

// In Piscina's ThreadPool constructor:
new ThreadPool() // <-- Throws "Not implemented" 

This is where Piscina uses Node.js worker_threads APIs that Bun 1.2.14+ explicitly marks as ā€œNot implementedā€:

  • worker_threads.Worker constructor
  • MessageChannel / MessagePort
  • Worker thread communication APIs

Impact on Repomix:

Repomix heavily relies on Piscina for parallel processing in multiple places:

  • File collection (src/core/file/fileCollect.ts:10) - Where the error occurs first
  • Security scanning (src/core/security/securityCheck.ts)
  • Metrics calculation (src/core/metrics/calculateAllFileMetrics.ts)
  • Output metrics (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.md with:

  1. Version-specific testing: Install Bun 1.1.39 (works) vs 1.2.14+ (fails)
  2. API-level testing: Direct worker_threads API testing
  3. Environment verification: Check runtime versions and platform

Key Commands for Reproduction:

# Test with different Bun versions
curl -fsSL https://bun.sh/install | bash -s "bun-v1.1.39"  # Should work
curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.14"  # Should fail

# Quick API test to verify worker threads support
bun -e "import('worker_threads').then(w => new w.Worker('console.log(1)', {eval:true}))"

Why It Works on M2 Pro vs Fails on M4

The issue is Bun version, not chip architecture:

  • @yamadashy’s M2 Pro + Bun 1.1.39: Uses partial worker threads implementation
  • @lancegoyke’s M4 + Bun 1.2.14: Uses stricter ā€œNot implementedā€ approach

Recommended Solutions

Immediate Workarounds (for users):

  1. Use Docker (as @lancegoyke discovered) - runs Node.js instead of Bun
  2. Use npx repomix instead of bunx repomix
  3. Downgrade to Bun 1.1.39 temporarily (not recommended)

Long-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:

bunx repomix

Environment:

bun 1.1.39
Apple M2 Pro
macOS Sonoma 14.4.1

I’ll dig into this further. Since the error is coming from Piscina (the parallel‐processing library), it may be something environment‐specific.