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

[!] (plugin closure-compiler) SyntaxError: Unexpected token (460:13) undefined (460:13) #457

Open
mohe2015 opened this issue Jan 3, 2022 · 2 comments

Comments

@mohe2015
Copy link

mohe2015 commented Jan 3, 2022

What's the issue?

Crashes with

[!] (plugin closure-compiler) SyntaxError: Unexpected token (460:13)
undefined (460:13)
SyntaxError: Unexpected token (460:13)
    at Parser.pp$4.raise (/home/moritz/Documents/projektwahl-lit/node_modules/acorn/dist/acorn.js:2927:15)
    at Parser.pp.unexpected (/home/moritz/Documents/projektwahl-lit/node_modules/acorn/dist/acorn.js:698:10)
    at Parser.pp.expect (/home/moritz/Documents/projektwahl-lit/node_modules/acorn/dist/acorn.js:692:28)
    at Parser.pp$3.parseMethod (/home/moritz/Documents/projektwahl-lit/node_modules/acorn/dist/acorn.js:2713:10)
    at Parser.pp$1.parseClassMethod (/home/moritz/Documents/projektwahl-lit/node_modules/acorn/dist/acorn.js:1399:25)
    at Parser.pp$1.parseClassElement (/home/moritz/Documents/projektwahl-lit/node_modules/acorn/dist/acorn.js:1388:10)
    at Parser.pp$1.parseClass (/home/moritz/Documents/projektwahl-lit/node_modules/acorn/dist/acorn.js:1326:26)
    at Parser.pp$1.parseStatement (/home/moritz/Documents/projektwahl-lit/node_modules/acorn/dist/acorn.js:842:19)
    at Parser.pp$1.parseTopLevel (/home/moritz/Documents/projektwahl-lit/node_modules/acorn/dist/acorn.js:755:23)
    at Parser.parse (/home/moritz/Documents/projektwahl-lit/node_modules/acorn/dist/acorn.js:555:17)

How do we reproduce the issue?

git clone https://github.com/projektwahl/projektwahl-lit.git
cd projektwahl-lit
git checkout 68d1c1b28382a127511d1b8a9eb77006426afc92
npm install
npm run localize-build
npm run rollup

Additional information

I think this may be because of the outdated acorn dependency and may simply be fixed by updating it.

@danimoh
Copy link

danimoh commented Jan 24, 2022

I ran into the same issue with the usage of modern JS features, in my case class fields.
As I'm using typescript in my project, I could set its target to ES2017 to transpile my code down to that older ES version that the used acorn version still understands.
I did not experiment with updating acorn, but I too believe that it's probably the cause of the described issue.

If you want to figure out what code is triggering the issue in your case, you can patch your node_modules/acorn/dist/acorn.js:2927:15 with a console.log(this.input);.

@eguneys
Copy link

eguneys commented Jul 15, 2023

Please fix this asap....

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