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
Running v14.4, I launched my script with cli dynamic import: node -e 'import("./seed.js").then(({open})=>open());'
and I get the following error on fork process creation:
TypeError [ERR_INVALID_ARG_TYPE]: The "modulePath" argument must be of type string. Received undefined
at validateString (internal/validators.js:121:11)
at fork (child_process.js:63:3)
at createWorkerProcess (internal/cluster/master.js:132:10)
at EventEmitter.cluster.fork (internal/cluster/master.js:167:25)
at file:///media/fuse/drivefs-fb63ac1d072197a08fd8e42d246fd29a/root/www.blikpatrik.net/Blik_2020_seed.js:40:58
at Array.map (<anonymous>)
at file:///media/fuse/drivefs-fb63ac1d072197a08fd8e42d246fd29a/root/www.blikpatrik.net/Blik_2020_seed.js:40:41
in internal/cluster/master.js:132, createWorkerProcess(id,env) function passes cluster.settings.exec down empty to fork(modulePath)
after cluster.setupMaster() has it set from process.argv[1]
(which is empty due to --eval usage)
at internal/cluster/master.js:57.
I see running code dynamically as an equally reasonable use case
for forking processes so i suppose this is not intended.
I wonder if import.meta.url could be utilised for a solution, at least as an optional argument.
The text was updated successfully, but these errors were encountered:
bpstrngr
changed the title
cluster.settings.exec undefined as cluster.fork() argument when called in repl
cluster.fork() fails when called in repl (cluster.settings.exec undefined)
Oct 2, 2020
The solution for me in the meantime has been to set a mock entry point before forking,
which a bit surprisingly doesn't influence the childprocesses
launching with the correct initial command so it works fine. if(!process.argv[1]) process.argv[1]=import.meta.url;
Running v14.4, I launched my script with cli dynamic import:
node -e 'import("./seed.js").then(({open})=>open());'
and I get the following error on fork process creation:
in internal/cluster/master.js:132,
createWorkerProcess(id,env)
function passescluster.settings.exec
down empty tofork(modulePath)
after
cluster.setupMaster()
has it set fromprocess.argv[1]
(which is empty due to --eval usage)
at internal/cluster/master.js:57.
I see running code dynamically as an equally reasonable use case
for forking processes so i suppose this is not intended.
I wonder if import.meta.url could be utilised for a solution, at least as an optional argument.
Thanks for the attention!
only related issue i found:
#27039
The text was updated successfully, but these errors were encountered: