develar / 7zip-bin

7-Zip precompiled binaries
MIT License
117 stars 33 forks source link

path7za return "undefinedwin/x64//7za.exe" in windows 11 #17

Open darkfiredarkhalo opened 2 years ago

darkfiredarkhalo commented 2 years ago

image

marko-hologram commented 1 year ago

It seems you are potentially using this code in browser/renderer where __dirname doesn't exist. __dirname is a Node.js API and it's not available in browsers.

I don't have full code here to evaluate this, but judging by "Compiling Renderer Code" logs being shown here it seems that this library is being required in context where __dirname just doesn't exist.

stefan-girlich commented 1 year ago

Experiencing the same issue on Windows 10, using 7zip-bin via 7zip-min and Electron Forge. In the Electron main process, __dirname is set to my-project-dir\.webpack\main