You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: commandkit dev fails with [UNHANDLEABLE_ERROR] Invalid argument (os error 22) #594
When running the commandkit dev command, the build process fails immediately with an unhandleable error originating from rolldown.
Error/stack:
Build failed: Error: Build failed with 1 error:
[UNHANDLEABLE_ERROR] Error: Something went wrong inside rolldown, please report this problem at https://github.com/rolldown/rolldown/issues.
Invalid argument (os error 22)
at aggregateBindingErrorsIntoJsError (file:///media/maybeizen/External/projects/archive/netherhost/nethercore_v2/node_modules/rolldown/dist/shared/src-CPA2meNe.mjs:2485:18)
at unwrapBindingResult (file:///media/maybeizen/External/projects/archive/netherhost/nethercore_v2/node_modules/rolldown/dist/shared/src-CPA2meNe.mjs:2460:128)
at RolldownBuild.write (file:///media/maybeizen/External/projects/archive/netherhost/nethercore_v2/node_modules/rolldown/dist/shared/src-CPA2meNe.mjs:4242:33)
at async build (file:///media/maybeizen/External/projects/archive/netherhost/nethercore_v2/node_modules/rolldown/dist/shared/src-CPA2meNe.mjs:4275:22)
at async file:///media/maybeizen/External/projects/archive/netherhost/nethercore_v2/node_modules/tsdown/dist/src-Cy1Bj4rU.mjs:1380:24
at async Promise.all (index 0)
at async rebuild (file:///media/maybeizen/External/projects/archive/netherhost/nethercore_v2/node_modules/tsdown/dist/src-Cy1Bj4rU.mjs:1372:3)
at async buildSingle (file:///media/maybeizen/External/projects/archive/netherhost/nethercore_v2/node_modules/tsdown/dist/src-Cy1Bj4rU.mjs:1360:2)
at async Promise.all (index 0)
at async build$1 (file:///media/maybeizen/External/projects/archive/netherhost/nethercore_v2/node_modules/tsdown/dist/src-Cy1Bj4rU.mjs:1329:19) {
errors: [Getter/Setter]
}
Desktop:
OS: Linux Mint 22.2
Node Version: v24.12.0
Package Manager: Bun v1.3.5
CommandKit Version: 1.2.0-rc.11
Additional Notes
This project is stored on an external SSD formatted as NTFS.
I can confirm this is an issue with the file system. I've moved the project to an internal SSD (ext4) and it resolved it. This suggests an issue between rolldown's file writing system and NTFS mount behaviors on Linux.
This maps to EINVAL, which usually means a low-level filesystem operation is not supported by the underlying filesystem.
Given that moving the project from NTFS to ext4 fixes the issue, this points to a filesystem compatibility problem rather than a logic bug in commandkit or tsdown.
A likely cause is that rolldown is using optimized file writes (most likely writable mmap, possibly also clone/copy syscalls). NTFS on Linux (via ntfs-3g or ntfs3) does not fully support these operations, and the kernel can return EINVAL in those cases. Native filesystems like ext4 don’t have this limitation, which explains why it works there.
Also worth noting: in dev mode, commandkit builds with unbundle: true and sourcemap: true by default, which results in many individual file writes. That increases the chance of hitting this limitation on NTFS.
To confirm the exact failing syscall, running under strace would help:
strace -f -o trace.log commandkit dev
Then check the end of the log for something like mmap, copy_file_range, or ioctl failing with EINVAL.
As for improvements, this probably needs handling in rolldown by falling back to a safe write when these operations fail. On the commandkit side, it could help to detect this case (error contains UNHANDLEABLE_ERROR + os error 22) and show a clearer message suggesting filesystem compatibility as the cause.
As a quick workaround, it might also be worth trying:
Activity
maybeizen commentedon Dec 20, 2025
I can confirm this is an issue with the file system. I've moved the project to an internal SSD (ext4) and it resolved it. This suggests an issue between rolldown's file writing system and NTFS mount behaviors on Linux.
siglag commentedon Apr 7, 2026
It looks like the failure is happening inside
RolldownBuild.writeand surfaces as:This maps to
EINVAL, which usually means a low-level filesystem operation is not supported by the underlying filesystem.Given that moving the project from NTFS to ext4 fixes the issue, this points to a filesystem compatibility problem rather than a logic bug in
commandkitortsdown.A likely cause is that rolldown is using optimized file writes (most likely writable
mmap, possibly also clone/copy syscalls). NTFS on Linux (viantfs-3gorntfs3) does not fully support these operations, and the kernel can returnEINVALin those cases. Native filesystems like ext4 don’t have this limitation, which explains why it works there.Also worth noting: in dev mode,
commandkitbuilds withunbundle: trueandsourcemap: trueby default, which results in many individual file writes. That increases the chance of hitting this limitation on NTFS.To confirm the exact failing syscall, running under
stracewould help:Then check the end of the log for something like
mmap,copy_file_range, orioctlfailing withEINVAL.As for improvements, this probably needs handling in rolldown by falling back to a safe write when these operations fail. On the
commandkitside, it could help to detect this case (error containsUNHANDLEABLE_ERROR+os error 22) and show a clearer message suggesting filesystem compatibility as the cause.As a quick workaround, it might also be worth trying:
to reduce the number of file writes.
If needed, I can help analyze a
stracelog or try to narrow down the exact syscall causing this.