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
Windows fs symlink TypeError on Buffer target value #34514
How often does it reproduce? Is there a required condition?
Always happens on Windows since 14.5.0, it may be necessary to enable symlink support on Windows (I'm not 100% sure how that all works). Does not happen on Linux or macOS.
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Buffer
internal/validators.js:121
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Buffer
at validateString (internal/validators.js:121:11)
at Object.isAbsolute (path.js:353:5)
at preprocessSymlinkDestination (internal/fs/utils.js:345:18)
at Object.symlinkSync (fs.js:1118:19)
at Object.<anonymous> (C:\Users\travis\build\AlexanderOMara\issue-node-symlink-buffer-windows\main.js:5:4)
at Module._compile (internal/modules/cjs/loader.js:1236:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1257:10)
at Module.load (internal/modules/cjs/loader.js:1085:32)
at Function.Module._load (internal/modules/cjs/loader.js:950:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
code: 'ERR_INVALID_ARG_TYPE'
}
Activity
[-]Windows fs symlink TypeError on buffer target value.[/-][+]Windows fs symlink TypeError on Buffer target value[/+]addaleax commentedon Jul 26, 2020
Could you share the full stack trace?
AlexanderOMara commentedon Jul 26, 2020
Sure! Added the stack trace from Travis.
addaleax commentedon Jul 26, 2020
@nodejs/fs
AlexanderOMara commentedon Jul 26, 2020
My guess is that this is the commit that created the issue, since
path.isAbsolute(and alsopath.toNamespacedPath) expect a string:a4e273b
There might also be a similar issue right above it if
typeisjunction, depending on howpath.resolvehandles things that are not strings.fs: fix when path is buffer on fs.symlinkSync
3cp commentedon Aug 9, 2020
It also affected v12.18.3, please release the patch to v12 too. Thx.
fs: fix when path is buffer on fs.symlinkSync