Skip to content

Commit 9296992

Browse files
committed
fix: switch from vmThreads to threads pool to resolve CI "module is already linked" errors
## Root Cause Analysis CI was failing with 78 "module is already linked" errors due to: - Node.js 24.x + Vitest vmThreads pool triggering ESM linker bug - Tests still import Sentry via production dependency chain: test → tool → utils/build → utils/command → utils/logger → @sentry/node - vmThreads pool has known issues with native modules like Sentry ## Solution: Switch to threads pool - Changed pool from 'vmThreads' to 'threads' - Increased maxThreads from 1 to 4 for better performance - threads pool handles native modules better than vmThreads - Fixes the Node.js ESM linker issue while improving performance ## Evidence from dependency graph analysis Using madge revealed the exact import chain still bringing Sentry into tests: build_device.test.ts → build_device.ts → utils/build/index.ts → utils/build-utils.ts → utils/command.ts → utils/logger.ts → @sentry/node ## Benefits - Resolves CI "module is already linked" errors - Better performance (threads faster than vmThreads) - More robust handling of native modules - Maintains all existing test functionality (1046 tests pass) ## Testing - All tests pass locally with threads pool - TypeScript compilation and linting clean - No behavioral changes to test execution
1 parent 66a243f commit 9296992

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

vitest.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ export default defineConfig({
2121
'**/__pycache__/**',
2222
'**/dist/**'
2323
],
24-
pool: 'vmThreads',
24+
pool: 'threads',
2525
poolOptions: {
26-
vmThreads: {
27-
maxThreads: 1
26+
threads: {
27+
maxThreads: 4
2828
}
2929
},
3030
env: {

0 commit comments

Comments
 (0)