Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

304
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda