forge icon indicating copy to clipboard operation
forge copied to clipboard

__webpack_require__.ab is undefined on Windows

Open mtoso opened this issue 2 years ago • 3 comments

Pre-flight checklist

  • [X] I have read the contribution documentation for this project.
  • [X] I agree to follow the code of conduct that this project uses.
  • [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.2.1

Electron version

24.1.2

Operating system

Windows 11

Last known working Electron Forge version

No response

Expected behavior

Have this line defined on the .webpack/main bundle:

if (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + "/native_modules/";

Actual behavior

This line if (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + "/native_modules/"; is completely missing from the webpack main process bundle

Steps to reproduce

  • Create a new project with the webpack template
  • Use a native node module in windows and run npm start

Additional information

Very similar to this issue https://github.com/electron/forge/issues/3183. It would be a bummer to have to switch to something different from electron-forge

mtoso avatar Jun 21 '23 05:06 mtoso

is there a workaround for this ?

sibelius avatar Aug 29 '23 18:08 sibelius

related to https://github.com/vercel/webpack-asset-relocator-loader/issues/161

sibelius avatar Aug 29 '23 18:08 sibelius

still not fixed :(

geetee24 avatar Jan 30 '25 04:01 geetee24