node-ytdl-core: Angular Electron not building on 2.1.5 Unexpected token: punc ()
On 2.1.5 my electron angular 7 app runs when npm start, but on production mode it fails like this:
ERROR in main.cd7adcc1ce764ef292fd.js from Terser Unexpected token: punc ()) [./node_modules/ytdl-core/lib/info.js:147,0][main.cd7adcc1ce764ef292fd.js:96082,4]
My typescript target is es2015
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (10 by maintainers)
Commits related to this issue
- fix: Fix error when compiling with electron (#647) * Fixes #645: Unexpected token: punc () in sig.js * Attempt to avoid lint requirement for trailing comma — committed to fent/node-ytdl-core by digimezzo 4 years ago
- Fixes #645 for v2 branch — committed to digimezzo/node-ytdl-core by deleted user 4 years ago
- fix: fix one more error when compiling with electron and angular (#651) Fixes #645 — committed to fent/node-ytdl-core by digimezzo 4 years ago
- fix: Fix error when compiling with electron (#647) * Fixes #645: Unexpected token: punc () in sig.js * Attempt to avoid lint requirement for trailing comma — committed to keeptpa/node-ytdl-core by digimezzo 4 years ago
I fixed the pull request. Lint requires a trailing comma after the last element of an array, or variable definition, if the end bracket is on another line than the last array element or variable definition.
Putting the comma there, however, breaks the webpack build. This seems caused by a rule in the terser webpack plugin. I found an identical issue here: https://github.com/vega/vega/issues/2645