Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produces Angular Build Error "Unexpected token: punc ())" #56

Closed
danouche93 opened this issue Apr 20, 2020 · 1 comment
Closed

Produces Angular Build Error "Unexpected token: punc ())" #56

danouche93 opened this issue Apr 20, 2020 · 1 comment

Comments

@danouche93
Copy link

Hi,
thanks to your plugin, I successfully convert videos to mp4. My problems is when I run ng build --prod

Describe the bug
To identify where the error was, I used ng build --prod --named-chunks --verbose --build-optimizer=false --source-map and got this error:

ERROR in education-education-module-ngfactory.491f3b07ab6e60c37d72.js from UglifyJs Unexpected token: punc ()) [./node_modules/@ffmpeg/ffmpeg/src/createWorker.js:135,0][education-education-module-ngfactory.491f3b07ab6e60c37d72.js:1489,4]

To Reproduce
I use Angular CLI: 6.2.4
Node: 12.16.1
OS: win32 x64
Angular: 6.1.9
The error occured when running ng build --prod

Additional context
With some research on the internet, I see that several people had the same problem with differents plugins. The problem was that there are extra comma.
So I search in createWorker.js if there were extra comma and indeed there are.
On line 134:
jobId, // here is extra comma
On line 141:
jobId, // extra comma too
On line 192:
setLogging(true); , // extra comma too`

When I delete all of these extra comma, my project build successfully, please include this fix.

@jeromewu
Copy link
Collaborator

It should work in the latest version, please try again.
BTW, the comma is convention we used in this repository, so we won't remove it for angular if there is another workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants