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

ES2022 - terser can not handle syntax ( SyntaxError: Unexpected token: punc ({) ) #539

Closed
AdamKundracik opened this issue Dec 14, 2022 · 3 comments

Comments

@AdamKundracik
Copy link

Hi everyone,

Today I was challenging this error during run of app build script

Error: Optimization error [libs_frontend_core_widgets_divider_src_index_ts.cb12a303421ad2b8.js]: SyntaxError: Unexpected token: punc ({)

First I was thinking it's just package problem but nothing could fix it.

Then I found guy, having same issue as me on stack overflow.

HOW TO FIX IT?

  1. Go to you tsconfig.json
  2. search for "target"
  3. Change it to ES2020 (Worked for me)
  4. Enjoy working build

Hopefully this help someone because I cried for 5 hours fixing this

@alexander-akait
Copy link
Member

Pinned, so all will see this at the top of issues, close, thank you

@dmitryshelomanov
Copy link

@alexander-akait not working for me

@dmitryshelomanov
Copy link

server.js from Terser
Unexpected token: punc (.)

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

3 participants