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 }}
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
Calling fs.stat function with buffer as a path parameter. getting the following error after packaging the app using pkg.
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Buffer
at validateString (internal/validators.js:117:11)
at Object.dirname (path.js:1128:5)
at isRootPath (pkg/prelude/bootstrap.js:168:26)
at Object.fs.readdir (pkg/prelude/bootstrap.js:850:18)
at onStat (/snapshot/node-dx/node_modules/node-dir/lib/paths.js:160:12)
at FSReqCallback.oncomplete (fs.js:167:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
fs.stat can accept string | Buffer | URL
After debugging found issue in isRootPath function of the bootstrap.js.
function isRootPath (p) {
if (p === '.') p = require('path').resolve(p);
return require('path').dirname(p) === p;
}
dirname function of path module only accepts string not buffer. After making changes to convert buffer into the string. everything was working.
But this hack will not work in the CI environment. Please help us to resolve this issue asap.
The text was updated successfully, but these errors were encountered:
internal/validators.js:117
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:117:11)
at Object.dirname (path.js:1128:5)
at isRootPath (pkg/prelude/bootstrap.js:168:26)
at Object.fs.readdir (pkg/prelude/bootstrap.js:850:18)
at readDir (/snapshot/practice/pkgFs.js)
at Object. (/snapshot/practice/pkgFs.js)
at Module._compile (pkg/prelude/bootstrap.js:1324:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14) {
code: 'ERR_INVALID_ARG_TYPE'
}
Calling fs.stat function with buffer as a path parameter. getting the following error after packaging the app using pkg.
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Buffer
at validateString (internal/validators.js:117:11)
at Object.dirname (path.js:1128:5)
at isRootPath (pkg/prelude/bootstrap.js:168:26)
at Object.fs.readdir (pkg/prelude/bootstrap.js:850:18)
at onStat (/snapshot/node-dx/node_modules/node-dir/lib/paths.js:160:12)
at FSReqCallback.oncomplete (fs.js:167:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
fs.stat can accept string | Buffer | URL
After debugging found issue in isRootPath function of the bootstrap.js.
function isRootPath (p) {
if (p === '.') p = require('path').resolve(p);
return require('path').dirname(p) === p;
}
dirname function of path module only accepts string not buffer. After making changes to convert buffer into the string. everything was working.
But this hack will not work in the CI environment. Please help us to resolve this issue asap.
The text was updated successfully, but these errors were encountered: