Closed incapdns closed 2 years ago
Plz verify linux too.
Same issue on linux
Any update on this? We are facing same issue with Node Cluster enabled. When can we expect this fix to be released ?
I also encountered the same issue. Is there a temporary plan? Thx
Temporary fix:
childProcess.spawn = function spawn() {
const args = cloneArgs(arguments);
setOptsEnv(args);
modifyShort(args);
// https://github.com/vercel/pkg/issues/1126
if (args[0] === EXECPATH) {
// filter
args[1] = args[1].filter(arg => {
if ([
'--no-deprecation',
'--require',
'node_modules/source-map-support/register.js',
'--max_old_space_size',
].some(_arg => arg.includes(_arg))) {
return false;
}
return true;
});
}
return ancestor.spawn.apply(childProcess, args);
};
it can fix #1126 also
But the patch code is missing the --require
feature
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.
same issue here.
Temporary fix:
childProcess.spawn = function spawn() { const args = cloneArgs(arguments); setOptsEnv(args); modifyShort(args); // https://github.com/vercel/pkg/issues/1126 if (args[0] === EXECPATH) { // filter args[1] = args[1].filter(arg => { if ([ '--no-deprecation', '--require', 'node_modules/source-map-support/register.js', '--max_old_space_size', ].some(_arg => arg.includes(_arg))) { return false; } return true; }); } return ancestor.spawn.apply(childProcess, args); };
it can fix #1126 also
Where should we put this code?
For anyone who struggles with this problem, try to install the solved version of pkg
directly from this PR https://github.com/vercel/pkg/pull/1462.
NPM
npm install github:bergheim/pkg#forked-runtime-options
PNPM
pnpm add github:bergheim/pkg#forked-runtime-options
After you run one of the commands above, you'll see that the pkg
dependency's version will be changed:
package.json
{
"devDependencies": {
"pkg": "github:bergheim/pkg#forked-runtime-options"
}
}
The cluster is disconnecting (closing) when using "--options" when compiling with PKG, example: pkg test.js --options max_old_space_size = 4096
Example code:
Node version: v14.15.5 OS: Windows
It is noticed that this happens only in the cluster (child)
Log: