electron-userland / electron-userland/electron-webpack

undefined error from Terser

Open
#262 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
902
Forks
168
PR merge metrics
No merged PRs in 30d

Description

I seem to be having an issue with building my application, where it fails due to an undefined error from Terser:
```
ERROR in main.js from Terser
undefined
```

Fortunately, as my program is still quite small, I was able to narrow it down to this piece of code:
```js
function mainToV1(config) {
const converted = { ...config };
converted.configVersion = 1;
return converted;
}
```
Regardless of where I put this, it will cause the build to fail, and as soon as I remove the third line, it will work again.

I should also note that the code runs fine in dev mode.

I am running the latest version of electron-webpack on Windows 10 with Node v10.14.0

Any help resolving this issue will be much appreciated.

edit:
I have found that using the following instead is a workaround:
```js
function mainToV1(config) {
let converted = {};
converted = { ...config };
converted.configVersion = 1;
return converted;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.