Please describe your issue:
I'm receiving the following error in production mode only:
It has been very tough to track down the source of this error. I've tried adding:
process.on('uncaughtException, (exception) => // etc.)
with no luck. Has anyone experienced a similar issue?
Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.
Put the console output here
What command line arguments are you passing?
Put the arguments here
What does your config.forge data in package.json look like?
module.exports = {
packagerConfig: {
},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
name: 'webapp',
certificateFile: './assets/test.pfx',
certificatePassword: 'password',
loadingGif: './assets/installer.gif',
useAppIdAsId: false,
iconUrl:
'http://www.iconarchive.com/download/i78656/icons-land/medical/Documents-Caduceus.ico',
remoteReleases: 'http://server',
},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
],
plugins: [
[
'@electron-forge/plugin-webpack',
{
mainConfig: './webpack.main.config.js',
renderer: {
config: './webpack.renderer.config.js',
entryPoints: [
{
html: './src/index.html',
js: './src/index.tsx',
name: 'main_window',
},
],
},
},
],
],
};
Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init is a good starting point, if that is not the
source of your problem.
This only started happening a few weeks ago and I have not been able to track down the cause.
@damianesteban From the sounds of it you've found a webpack minification bug 馃
I'd suggest you modify your webpack configuration to disable asset minimization and see if that fixes the issue. Even if it doesn't fix it, it should make the error message more readable
Thank you. I'll do that and see what happens :).
Thank you. We discovered that it had to do with using the path module before it was actually imported via require.
Most helpful comment
@damianesteban From the sounds of it you've found a webpack minification bug 馃
I'd suggest you modify your webpack configuration to disable asset minimization and see if that fixes the issue. Even if it doesn't fix it, it should make the error message more readable