0

I've used Crypto-ES package in Angular 7 codebase and it is working fine when I run the project.

However, when I try to ng build --prod the code, I get the following error:

ERROR in modules-login-login-module-ngfactory.0e87ddf2fd23f5d113c2.js from Terser Unexpected token: punc ()) [./node_modules/crypto-es/lib/evpkdf.js:41,0][modules-login-login-module-ngfactory.0e87ddf2fd23f5d113c2.js:1318,4]

In the above error message, login module is the component in which I've implemented the logic.

I've updated the compiler options as suggested, but still the error doesn't go.

Please advise.

Ashish Deora
  • 179
  • 1
  • 9
  • Is https://stackoverflow.com/questions/54380816/unexpected-token-punc-when-building-for-production answering your question ? – KBell Dec 15 '21 at 08:36
  • Thank you :) Actually I tried the source-map thing suggested on this to get the above output. Sadly, this doesn't helped. There are not missing colons, commas or anything like that in the entire code base – Ashish Deora Dec 15 '21 at 08:41

1 Answers1

0

I didn't find satisfactory answer anywhere. Hence, I ended up using the original package. Though it is not maintained and it is outdated, I was running out of time. The development had to be completed in a day's time.

The question that I referred to is How to use CryptoJS with Angular 4

Ashish Deora
  • 179
  • 1
  • 9