nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

Fork and fs-extra in nwjs

Open jssuttles opened this issue 7 months ago • 5 comments

NW.js version: 0.99.1 OS version: Microsoft Windows [Version 10.0.26100.4061]

Running a fork inside of nwjs seems to work unless certain dependencies are loaded into the fork at which point it exits with code 3221226505.

Reproduced here: https://github.com/jssuttles/nw-fork-issue

jssuttles avatar May 22 '25 20:05 jssuttles

I checked with a colleague, and it doesn't break on Mac

jssuttles avatar May 22 '25 21:05 jssuttles

When you change it to node inside of nwjs, it works again. const child = require('node:child_process').fork(forkModule,[],{execPath: 'node'});

jssuttles avatar May 22 '25 21:05 jssuttles

Spoke in Gitter. Recommeneded isolating the part of fs-extra that causes the issue so we can look into the root cause.

TheJaredWilcurt avatar May 29 '25 01:05 TheJaredWilcurt

Hey @TheJaredWilcurt, I'm not sure if I found a root cause, but I've narrowed it down further by removing a lot of code from a package (I picked archiver). The readme describes how to get to a point that should work, but causes the issue. Running a require call at that point seems to break almost no matter what I do. I can run something like require('is-buffer') at that point, but I can't run require('../stream') where 'stream.js' is replaced with just module.exports = {}.

jssuttles avatar May 29 '25 14:05 jssuttles

That's still a large reproduction. can you make a minimal version that has the fewest lines of code and dependencies. Ideally no dependencies at all, tracking down whatever is in the dependency that is cause the issue.

TheJaredWilcurt avatar Jun 03 '25 16:06 TheJaredWilcurt

Closing, re-open with more information.

TheJaredWilcurt avatar Jul 13 '25 12:07 TheJaredWilcurt