Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

305
Views
Parcel - Unexpected token name «_28», expected punc «,»

I am using Color JavaScript Library in my Code, And I Am Using Parcel JS for bundling my Code.

When I Am Running Parcel JS For Development Using This Command -

  • parcel public/index.html

Everything Works Fine.

But When I Build My Code For Production Using This Command -

  • parcel build public/index.html --public-url ./ --target browser

I Get This Error -

> neusprite@0.0.1 build
> parcel build public/index.html --public-url ./ --target browser

🚨  /home/aditya/Documents/Codes/NeuSprite/node_modules/color/index.js: Unexpected token name «_28», expected punc «,»
    at Z.get (/home/aditya/Documents/Codes/NeuSprite/node_modules/terser/dist/bundle.min.js:1:525)
    at Object.errorToJson (/home/aditya/Documents/Codes/NeuSprite/node_modules/@parcel/utils/src/errorUtils.js:9:20)
    at Pipeline.process (/home/aditya/Documents/Codes/NeuSprite/node_modules/parcel-bundler/src/Pipeline.js:29:26)
    at async Object.run (/home/aditya/Documents/Codes/NeuSprite/node_modules/parcel-bundler/src/worker.js:15:12)
    at async Child.handleRequest (/home/aditya/Documents/Codes/NeuSprite/node_modules/@parcel/workers/src/child.js:60:26)

One thing to note is that when i use this following option --no-minify like this parcel build public/index.html --public-url ./ --target browser --no-minify it Just Works Fine.

On StackoverFlow I Found this Answer

UglifyJs does not support ES6. The error is very likely the method shorthand syntax.

But On The Parcel JS Documentation They Have Mentioned that they Use Terser

Parcel uses terser to minify JavaScript, cssnano for CSS, htmlnano for HTML, and svgo for SVG. If needed, you can configure these tools using a .terserrc, .cssnanorc, .htmlnanorc, or svgo.config.json config file. See the docs for JavaScript, CSS, HTML, and SVG for more details.

And Terser Clearly Mentions It is Suitable For ES6+ On Their GitHub Page.

A JavaScript parser and mangler/compressor toolkit for ES6+.

Then Why I Am I getting This Error?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!