Error In Runtime From Terser During Build --prod












22















I have updated everything Angular and am now getting the error below (4x) when I

"Build --prod"



No errors if I remove --prod



I have no real code in this app. It is just a starter shell.



Any suggestions on what to look into?



ERROR in runtime.82c6613acef8f7246fe8.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:197:13)
at emit (internal/child_process.js:828:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)




My current Version



Angular CLI: 7.3.0  
Node: 11.8.0
OS: darwin x64
Angular: 7.2.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.13.0
@angular-devkit/build-angular 0.13.0
@angular-devkit/build-optimizer 0.13.0
@angular-devkit/build-webpack 0.13.0
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cli 7.3.0
@angular/pwa 0.6.8
@ngtools/webpack 7.3.0
@schematics/angular 0.6.8
@schematics/update 0.13.0
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.0









share|improve this question

























  • Note: Running this works "ng build --prod --optimization=false"

    – Mathias
    Feb 2 at 21:50






  • 2





    I've encountered the same issue like 20 minutes ago. The problem was that I had removed package-lock.json file.

    – Nuurek
    Feb 2 at 22:09











  • Thanks @Nuurek. Unfortunately, mine is there. And I did a npm Install just to try and rebuild it.

    – Mathias
    Feb 2 at 22:15
















22















I have updated everything Angular and am now getting the error below (4x) when I

"Build --prod"



No errors if I remove --prod



I have no real code in this app. It is just a starter shell.



Any suggestions on what to look into?



ERROR in runtime.82c6613acef8f7246fe8.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:197:13)
at emit (internal/child_process.js:828:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)




My current Version



Angular CLI: 7.3.0  
Node: 11.8.0
OS: darwin x64
Angular: 7.2.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.13.0
@angular-devkit/build-angular 0.13.0
@angular-devkit/build-optimizer 0.13.0
@angular-devkit/build-webpack 0.13.0
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cli 7.3.0
@angular/pwa 0.6.8
@ngtools/webpack 7.3.0
@schematics/angular 0.6.8
@schematics/update 0.13.0
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.0









share|improve this question

























  • Note: Running this works "ng build --prod --optimization=false"

    – Mathias
    Feb 2 at 21:50






  • 2





    I've encountered the same issue like 20 minutes ago. The problem was that I had removed package-lock.json file.

    – Nuurek
    Feb 2 at 22:09











  • Thanks @Nuurek. Unfortunately, mine is there. And I did a npm Install just to try and rebuild it.

    – Mathias
    Feb 2 at 22:15














22












22








22


3






I have updated everything Angular and am now getting the error below (4x) when I

"Build --prod"



No errors if I remove --prod



I have no real code in this app. It is just a starter shell.



Any suggestions on what to look into?



ERROR in runtime.82c6613acef8f7246fe8.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:197:13)
at emit (internal/child_process.js:828:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)




My current Version



Angular CLI: 7.3.0  
Node: 11.8.0
OS: darwin x64
Angular: 7.2.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.13.0
@angular-devkit/build-angular 0.13.0
@angular-devkit/build-optimizer 0.13.0
@angular-devkit/build-webpack 0.13.0
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cli 7.3.0
@angular/pwa 0.6.8
@ngtools/webpack 7.3.0
@schematics/angular 0.6.8
@schematics/update 0.13.0
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.0









share|improve this question
















I have updated everything Angular and am now getting the error below (4x) when I

"Build --prod"



No errors if I remove --prod



I have no real code in this app. It is just a starter shell.



Any suggestions on what to look into?



ERROR in runtime.82c6613acef8f7246fe8.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:197:13)
at emit (internal/child_process.js:828:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)




My current Version



Angular CLI: 7.3.0  
Node: 11.8.0
OS: darwin x64
Angular: 7.2.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.13.0
@angular-devkit/build-angular 0.13.0
@angular-devkit/build-optimizer 0.13.0
@angular-devkit/build-webpack 0.13.0
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cli 7.3.0
@angular/pwa 0.6.8
@ngtools/webpack 7.3.0
@schematics/angular 0.6.8
@schematics/update 0.13.0
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.0






angular webpack angular-cli






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 2 at 22:26







Mathias

















asked Feb 2 at 21:38









MathiasMathias

8001515




8001515













  • Note: Running this works "ng build --prod --optimization=false"

    – Mathias
    Feb 2 at 21:50






  • 2





    I've encountered the same issue like 20 minutes ago. The problem was that I had removed package-lock.json file.

    – Nuurek
    Feb 2 at 22:09











  • Thanks @Nuurek. Unfortunately, mine is there. And I did a npm Install just to try and rebuild it.

    – Mathias
    Feb 2 at 22:15



















  • Note: Running this works "ng build --prod --optimization=false"

    – Mathias
    Feb 2 at 21:50






  • 2





    I've encountered the same issue like 20 minutes ago. The problem was that I had removed package-lock.json file.

    – Nuurek
    Feb 2 at 22:09











  • Thanks @Nuurek. Unfortunately, mine is there. And I did a npm Install just to try and rebuild it.

    – Mathias
    Feb 2 at 22:15

















Note: Running this works "ng build --prod --optimization=false"

– Mathias
Feb 2 at 21:50





Note: Running this works "ng build --prod --optimization=false"

– Mathias
Feb 2 at 21:50




2




2





I've encountered the same issue like 20 minutes ago. The problem was that I had removed package-lock.json file.

– Nuurek
Feb 2 at 22:09





I've encountered the same issue like 20 minutes ago. The problem was that I had removed package-lock.json file.

– Nuurek
Feb 2 at 22:09













Thanks @Nuurek. Unfortunately, mine is there. And I did a npm Install just to try and rebuild it.

– Mathias
Feb 2 at 22:15





Thanks @Nuurek. Unfortunately, mine is there. And I did a npm Install just to try and rebuild it.

– Mathias
Feb 2 at 22:15












5 Answers
5






active

oldest

votes


















20














It seems to be a problem with the recently released version 3.16 of Terser, here's the related issue in Terser and in Terser as a Webpack plugin.



In this VueJS issue they recommended to downgrade it to version 3.14.1. You can do it looking for the line in package.json containing "terser" and pin it as follows:



    "terser": "3.14.1",





share|improve this answer


























  • Thanks @pietro. I'll go look at that. I don't THINK I am setting the Terser version anywhere in my Angular config. I think that is pulled in from webpack. So let me go play.

    – Mathias
    Feb 2 at 22:53






  • 1





    We had to pin it in package.json in dependencies as follows: "terser": "^3.14.1". I think by default it pulls the latest version.

    – Pietro Saccardi
    Feb 2 at 22:56











  • Thank you @Pietro! That seems to have worked. I added "terser": "3.14.1" to my dependencies (no caret on mine), npm install, then the build with --prod worked.

    – Mathias
    Feb 2 at 23:13



















10














As Pietro Saccardi said, by now, it's necessary to fix the Terser version to 3.14.1 in the package.json as follows:
"terser": "3.14.1"



Don't use the ^ in the version or it could upgrade to 3.16.






share|improve this answer































    1














    To resolve the angular prod build issue, we need to fix the version of terser and terser-webpack-plugin to 3.14.1 in the package-lock.json. Below is what my looks like. Finally the production build is working for me.



      "terser": {
    "version": "3.14.1",
    "resolved": "https://registry.npmjs.org/terser/-/terser-3.14.1.tgz",
    "integrity": "sha512-NSo3E99QDbYSMeJaEk9YW2lTg3qS9V0aKGlb+PlOrei1X02r1wSBHCNX/O+yeTRFSWPKPIGj6MqvvdqV4rnVGw==",
    "dev": true,
    "requires": {
    "commander": "2.17.1",
    "source-map": "0.6.1",
    "source-map-support": "0.5.9"
    },
    "dependencies": {
    "source-map": {
    "version": "0.6.1",
    "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
    "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
    "dev": true
    }
    }
    },
    "terser-webpack-plugin": {
    "version": "1.1.0",
    "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.1.0.tgz",
    "integrity": "sha512-61lV0DSxMAZ8AyZG7/A4a3UPlrbOBo8NIQ4tJzLPAdGOQ+yoNC7l5ijEow27lBAL2humer01KLS6bGIMYQxKoA==",
    "dev": true,
    "requires": {
    "cacache": "11.3.2",
    "find-cache-dir": "2.0.0",
    "schema-utils": "1.0.0",
    "serialize-javascript": "1.6.1",
    "source-map": "0.6.1",
    "terser": "3.14.1",
    "webpack-sources": "1.3.0",
    "worker-farm": "1.6.0"
    },
    "dependencies": {
    "cacache": {
    "version": "11.3.2",
    "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz",
    "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==",
    "dev": true,
    "requires": {
    "bluebird": "3.5.3",
    "chownr": "1.1.1",
    "figgy-pudding": "3.5.1",
    "glob": "7.1.3",
    "graceful-fs": "4.1.15",
    "lru-cache": "5.1.1",
    "mississippi": "3.0.0",
    "mkdirp": "0.5.1",
    "move-concurrently": "1.0.1",
    "promise-inflight": "1.0.1",
    "rimraf": "2.6.3",
    "ssri": "6.0.1",
    "unique-filename": "1.1.1",
    "y18n": "4.0.0"
    }
    },
    "find-cache-dir": {
    "version": "2.0.0",
    "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz",
    "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==",
    "dev": true,
    "requires": {
    "commondir": "1.0.1",
    "make-dir": "1.3.0",
    "pkg-dir": "3.0.0"
    }
    },
    "find-up": {
    "version": "3.0.0",
    "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
    "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
    "dev": true,
    "requires": {
    "locate-path": "3.0.0"
    }
    },
    "locate-path": {
    "version": "3.0.0",
    "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
    "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
    "dev": true,
    "requires": {
    "p-locate": "3.0.0",
    "path-exists": "3.0.0"
    }
    },
    "lru-cache": {
    "version": "5.1.1",
    "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
    "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
    "dev": true,
    "requires": {
    "yallist": "3.0.3"
    }
    },
    "mississippi": {
    "version": "3.0.0",
    "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
    "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==",
    "dev": true,
    "requires": {
    "concat-stream": "1.6.2",
    "duplexify": "3.6.1",
    "end-of-stream": "1.4.1",
    "flush-write-stream": "1.0.3",
    "from2": "2.3.0",
    "parallel-transform": "1.1.0",
    "pump": "3.0.0",
    "pumpify": "1.5.1",
    "stream-each": "1.2.3",
    "through2": "2.0.5"
    }
    },
    "p-limit": {
    "version": "2.1.0",
    "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz",
    "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==",
    "dev": true,
    "requires": {
    "p-try": "2.0.0"
    }
    },
    "p-locate": {
    "version": "3.0.0",
    "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
    "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
    "dev": true,
    "requires": {
    "p-limit": "2.1.0"
    }
    },
    "p-try": {
    "version": "2.0.0",
    "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
    "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==",
    "dev": true
    },
    "pkg-dir": {
    "version": "3.0.0",
    "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
    "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
    "dev": true,
    "requires": {
    "find-up": "3.0.0"
    }
    },
    "pump": {
    "version": "3.0.0",
    "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
    "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
    "dev": true,
    "requires": {
    "end-of-stream": "1.4.1",
    "once": "1.4.0"
    }
    },
    "source-map": {
    "version": "0.6.1",
    "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
    "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
    "dev": true
    },
    "ssri": {
    "version": "6.0.1",
    "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
    "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
    "dev": true,
    "requires": {
    "figgy-pudding": "3.5.1"
    }
    },
    "yallist": {
    "version": "3.0.3",
    "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
    "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
    "dev": true
    }
    }
    }





    share|improve this answer































      1














      The above answers are correct. Terser plugin is required to downgrade to version 3.14.1. But here is the procedure for doing that :




      1. Open package-lock.json file.

      2. Replace the version of terser to 3.14.1. Refer this answer for where to make changes.

      3. open cmd and run the command npm install terser@3.14.1.

      4. Now you can run ng build --prod for production build.






      share|improve this answer































        1














        For Angular prod build, this fixed it for me:



        npm install --save-exact --save terser@3.14





        share|improve this answer

























          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54497782%2ferror-in-runtime-from-terser-during-build-prod%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          5 Answers
          5






          active

          oldest

          votes








          5 Answers
          5






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          20














          It seems to be a problem with the recently released version 3.16 of Terser, here's the related issue in Terser and in Terser as a Webpack plugin.



          In this VueJS issue they recommended to downgrade it to version 3.14.1. You can do it looking for the line in package.json containing "terser" and pin it as follows:



              "terser": "3.14.1",





          share|improve this answer


























          • Thanks @pietro. I'll go look at that. I don't THINK I am setting the Terser version anywhere in my Angular config. I think that is pulled in from webpack. So let me go play.

            – Mathias
            Feb 2 at 22:53






          • 1





            We had to pin it in package.json in dependencies as follows: "terser": "^3.14.1". I think by default it pulls the latest version.

            – Pietro Saccardi
            Feb 2 at 22:56











          • Thank you @Pietro! That seems to have worked. I added "terser": "3.14.1" to my dependencies (no caret on mine), npm install, then the build with --prod worked.

            – Mathias
            Feb 2 at 23:13
















          20














          It seems to be a problem with the recently released version 3.16 of Terser, here's the related issue in Terser and in Terser as a Webpack plugin.



          In this VueJS issue they recommended to downgrade it to version 3.14.1. You can do it looking for the line in package.json containing "terser" and pin it as follows:



              "terser": "3.14.1",





          share|improve this answer


























          • Thanks @pietro. I'll go look at that. I don't THINK I am setting the Terser version anywhere in my Angular config. I think that is pulled in from webpack. So let me go play.

            – Mathias
            Feb 2 at 22:53






          • 1





            We had to pin it in package.json in dependencies as follows: "terser": "^3.14.1". I think by default it pulls the latest version.

            – Pietro Saccardi
            Feb 2 at 22:56











          • Thank you @Pietro! That seems to have worked. I added "terser": "3.14.1" to my dependencies (no caret on mine), npm install, then the build with --prod worked.

            – Mathias
            Feb 2 at 23:13














          20












          20








          20







          It seems to be a problem with the recently released version 3.16 of Terser, here's the related issue in Terser and in Terser as a Webpack plugin.



          In this VueJS issue they recommended to downgrade it to version 3.14.1. You can do it looking for the line in package.json containing "terser" and pin it as follows:



              "terser": "3.14.1",





          share|improve this answer















          It seems to be a problem with the recently released version 3.16 of Terser, here's the related issue in Terser and in Terser as a Webpack plugin.



          In this VueJS issue they recommended to downgrade it to version 3.14.1. You can do it looking for the line in package.json containing "terser" and pin it as follows:



              "terser": "3.14.1",






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 3 at 18:06

























          answered Feb 2 at 22:43









          Pietro SaccardiPietro Saccardi

          2,0542432




          2,0542432













          • Thanks @pietro. I'll go look at that. I don't THINK I am setting the Terser version anywhere in my Angular config. I think that is pulled in from webpack. So let me go play.

            – Mathias
            Feb 2 at 22:53






          • 1





            We had to pin it in package.json in dependencies as follows: "terser": "^3.14.1". I think by default it pulls the latest version.

            – Pietro Saccardi
            Feb 2 at 22:56











          • Thank you @Pietro! That seems to have worked. I added "terser": "3.14.1" to my dependencies (no caret on mine), npm install, then the build with --prod worked.

            – Mathias
            Feb 2 at 23:13



















          • Thanks @pietro. I'll go look at that. I don't THINK I am setting the Terser version anywhere in my Angular config. I think that is pulled in from webpack. So let me go play.

            – Mathias
            Feb 2 at 22:53






          • 1





            We had to pin it in package.json in dependencies as follows: "terser": "^3.14.1". I think by default it pulls the latest version.

            – Pietro Saccardi
            Feb 2 at 22:56











          • Thank you @Pietro! That seems to have worked. I added "terser": "3.14.1" to my dependencies (no caret on mine), npm install, then the build with --prod worked.

            – Mathias
            Feb 2 at 23:13

















          Thanks @pietro. I'll go look at that. I don't THINK I am setting the Terser version anywhere in my Angular config. I think that is pulled in from webpack. So let me go play.

          – Mathias
          Feb 2 at 22:53





          Thanks @pietro. I'll go look at that. I don't THINK I am setting the Terser version anywhere in my Angular config. I think that is pulled in from webpack. So let me go play.

          – Mathias
          Feb 2 at 22:53




          1




          1





          We had to pin it in package.json in dependencies as follows: "terser": "^3.14.1". I think by default it pulls the latest version.

          – Pietro Saccardi
          Feb 2 at 22:56





          We had to pin it in package.json in dependencies as follows: "terser": "^3.14.1". I think by default it pulls the latest version.

          – Pietro Saccardi
          Feb 2 at 22:56













          Thank you @Pietro! That seems to have worked. I added "terser": "3.14.1" to my dependencies (no caret on mine), npm install, then the build with --prod worked.

          – Mathias
          Feb 2 at 23:13





          Thank you @Pietro! That seems to have worked. I added "terser": "3.14.1" to my dependencies (no caret on mine), npm install, then the build with --prod worked.

          – Mathias
          Feb 2 at 23:13













          10














          As Pietro Saccardi said, by now, it's necessary to fix the Terser version to 3.14.1 in the package.json as follows:
          "terser": "3.14.1"



          Don't use the ^ in the version or it could upgrade to 3.16.






          share|improve this answer




























            10














            As Pietro Saccardi said, by now, it's necessary to fix the Terser version to 3.14.1 in the package.json as follows:
            "terser": "3.14.1"



            Don't use the ^ in the version or it could upgrade to 3.16.






            share|improve this answer


























              10












              10








              10







              As Pietro Saccardi said, by now, it's necessary to fix the Terser version to 3.14.1 in the package.json as follows:
              "terser": "3.14.1"



              Don't use the ^ in the version or it could upgrade to 3.16.






              share|improve this answer













              As Pietro Saccardi said, by now, it's necessary to fix the Terser version to 3.14.1 in the package.json as follows:
              "terser": "3.14.1"



              Don't use the ^ in the version or it could upgrade to 3.16.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Feb 2 at 23:12









              DanielDaniel

              24818




              24818























                  1














                  To resolve the angular prod build issue, we need to fix the version of terser and terser-webpack-plugin to 3.14.1 in the package-lock.json. Below is what my looks like. Finally the production build is working for me.



                    "terser": {
                  "version": "3.14.1",
                  "resolved": "https://registry.npmjs.org/terser/-/terser-3.14.1.tgz",
                  "integrity": "sha512-NSo3E99QDbYSMeJaEk9YW2lTg3qS9V0aKGlb+PlOrei1X02r1wSBHCNX/O+yeTRFSWPKPIGj6MqvvdqV4rnVGw==",
                  "dev": true,
                  "requires": {
                  "commander": "2.17.1",
                  "source-map": "0.6.1",
                  "source-map-support": "0.5.9"
                  },
                  "dependencies": {
                  "source-map": {
                  "version": "0.6.1",
                  "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
                  "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
                  "dev": true
                  }
                  }
                  },
                  "terser-webpack-plugin": {
                  "version": "1.1.0",
                  "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.1.0.tgz",
                  "integrity": "sha512-61lV0DSxMAZ8AyZG7/A4a3UPlrbOBo8NIQ4tJzLPAdGOQ+yoNC7l5ijEow27lBAL2humer01KLS6bGIMYQxKoA==",
                  "dev": true,
                  "requires": {
                  "cacache": "11.3.2",
                  "find-cache-dir": "2.0.0",
                  "schema-utils": "1.0.0",
                  "serialize-javascript": "1.6.1",
                  "source-map": "0.6.1",
                  "terser": "3.14.1",
                  "webpack-sources": "1.3.0",
                  "worker-farm": "1.6.0"
                  },
                  "dependencies": {
                  "cacache": {
                  "version": "11.3.2",
                  "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz",
                  "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==",
                  "dev": true,
                  "requires": {
                  "bluebird": "3.5.3",
                  "chownr": "1.1.1",
                  "figgy-pudding": "3.5.1",
                  "glob": "7.1.3",
                  "graceful-fs": "4.1.15",
                  "lru-cache": "5.1.1",
                  "mississippi": "3.0.0",
                  "mkdirp": "0.5.1",
                  "move-concurrently": "1.0.1",
                  "promise-inflight": "1.0.1",
                  "rimraf": "2.6.3",
                  "ssri": "6.0.1",
                  "unique-filename": "1.1.1",
                  "y18n": "4.0.0"
                  }
                  },
                  "find-cache-dir": {
                  "version": "2.0.0",
                  "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz",
                  "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==",
                  "dev": true,
                  "requires": {
                  "commondir": "1.0.1",
                  "make-dir": "1.3.0",
                  "pkg-dir": "3.0.0"
                  }
                  },
                  "find-up": {
                  "version": "3.0.0",
                  "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
                  "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
                  "dev": true,
                  "requires": {
                  "locate-path": "3.0.0"
                  }
                  },
                  "locate-path": {
                  "version": "3.0.0",
                  "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
                  "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
                  "dev": true,
                  "requires": {
                  "p-locate": "3.0.0",
                  "path-exists": "3.0.0"
                  }
                  },
                  "lru-cache": {
                  "version": "5.1.1",
                  "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
                  "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
                  "dev": true,
                  "requires": {
                  "yallist": "3.0.3"
                  }
                  },
                  "mississippi": {
                  "version": "3.0.0",
                  "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
                  "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==",
                  "dev": true,
                  "requires": {
                  "concat-stream": "1.6.2",
                  "duplexify": "3.6.1",
                  "end-of-stream": "1.4.1",
                  "flush-write-stream": "1.0.3",
                  "from2": "2.3.0",
                  "parallel-transform": "1.1.0",
                  "pump": "3.0.0",
                  "pumpify": "1.5.1",
                  "stream-each": "1.2.3",
                  "through2": "2.0.5"
                  }
                  },
                  "p-limit": {
                  "version": "2.1.0",
                  "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz",
                  "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==",
                  "dev": true,
                  "requires": {
                  "p-try": "2.0.0"
                  }
                  },
                  "p-locate": {
                  "version": "3.0.0",
                  "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
                  "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
                  "dev": true,
                  "requires": {
                  "p-limit": "2.1.0"
                  }
                  },
                  "p-try": {
                  "version": "2.0.0",
                  "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
                  "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==",
                  "dev": true
                  },
                  "pkg-dir": {
                  "version": "3.0.0",
                  "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
                  "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
                  "dev": true,
                  "requires": {
                  "find-up": "3.0.0"
                  }
                  },
                  "pump": {
                  "version": "3.0.0",
                  "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
                  "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
                  "dev": true,
                  "requires": {
                  "end-of-stream": "1.4.1",
                  "once": "1.4.0"
                  }
                  },
                  "source-map": {
                  "version": "0.6.1",
                  "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
                  "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
                  "dev": true
                  },
                  "ssri": {
                  "version": "6.0.1",
                  "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
                  "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
                  "dev": true,
                  "requires": {
                  "figgy-pudding": "3.5.1"
                  }
                  },
                  "yallist": {
                  "version": "3.0.3",
                  "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
                  "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
                  "dev": true
                  }
                  }
                  }





                  share|improve this answer




























                    1














                    To resolve the angular prod build issue, we need to fix the version of terser and terser-webpack-plugin to 3.14.1 in the package-lock.json. Below is what my looks like. Finally the production build is working for me.



                      "terser": {
                    "version": "3.14.1",
                    "resolved": "https://registry.npmjs.org/terser/-/terser-3.14.1.tgz",
                    "integrity": "sha512-NSo3E99QDbYSMeJaEk9YW2lTg3qS9V0aKGlb+PlOrei1X02r1wSBHCNX/O+yeTRFSWPKPIGj6MqvvdqV4rnVGw==",
                    "dev": true,
                    "requires": {
                    "commander": "2.17.1",
                    "source-map": "0.6.1",
                    "source-map-support": "0.5.9"
                    },
                    "dependencies": {
                    "source-map": {
                    "version": "0.6.1",
                    "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
                    "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
                    "dev": true
                    }
                    }
                    },
                    "terser-webpack-plugin": {
                    "version": "1.1.0",
                    "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.1.0.tgz",
                    "integrity": "sha512-61lV0DSxMAZ8AyZG7/A4a3UPlrbOBo8NIQ4tJzLPAdGOQ+yoNC7l5ijEow27lBAL2humer01KLS6bGIMYQxKoA==",
                    "dev": true,
                    "requires": {
                    "cacache": "11.3.2",
                    "find-cache-dir": "2.0.0",
                    "schema-utils": "1.0.0",
                    "serialize-javascript": "1.6.1",
                    "source-map": "0.6.1",
                    "terser": "3.14.1",
                    "webpack-sources": "1.3.0",
                    "worker-farm": "1.6.0"
                    },
                    "dependencies": {
                    "cacache": {
                    "version": "11.3.2",
                    "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz",
                    "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==",
                    "dev": true,
                    "requires": {
                    "bluebird": "3.5.3",
                    "chownr": "1.1.1",
                    "figgy-pudding": "3.5.1",
                    "glob": "7.1.3",
                    "graceful-fs": "4.1.15",
                    "lru-cache": "5.1.1",
                    "mississippi": "3.0.0",
                    "mkdirp": "0.5.1",
                    "move-concurrently": "1.0.1",
                    "promise-inflight": "1.0.1",
                    "rimraf": "2.6.3",
                    "ssri": "6.0.1",
                    "unique-filename": "1.1.1",
                    "y18n": "4.0.0"
                    }
                    },
                    "find-cache-dir": {
                    "version": "2.0.0",
                    "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz",
                    "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==",
                    "dev": true,
                    "requires": {
                    "commondir": "1.0.1",
                    "make-dir": "1.3.0",
                    "pkg-dir": "3.0.0"
                    }
                    },
                    "find-up": {
                    "version": "3.0.0",
                    "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
                    "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
                    "dev": true,
                    "requires": {
                    "locate-path": "3.0.0"
                    }
                    },
                    "locate-path": {
                    "version": "3.0.0",
                    "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
                    "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
                    "dev": true,
                    "requires": {
                    "p-locate": "3.0.0",
                    "path-exists": "3.0.0"
                    }
                    },
                    "lru-cache": {
                    "version": "5.1.1",
                    "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
                    "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
                    "dev": true,
                    "requires": {
                    "yallist": "3.0.3"
                    }
                    },
                    "mississippi": {
                    "version": "3.0.0",
                    "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
                    "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==",
                    "dev": true,
                    "requires": {
                    "concat-stream": "1.6.2",
                    "duplexify": "3.6.1",
                    "end-of-stream": "1.4.1",
                    "flush-write-stream": "1.0.3",
                    "from2": "2.3.0",
                    "parallel-transform": "1.1.0",
                    "pump": "3.0.0",
                    "pumpify": "1.5.1",
                    "stream-each": "1.2.3",
                    "through2": "2.0.5"
                    }
                    },
                    "p-limit": {
                    "version": "2.1.0",
                    "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz",
                    "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==",
                    "dev": true,
                    "requires": {
                    "p-try": "2.0.0"
                    }
                    },
                    "p-locate": {
                    "version": "3.0.0",
                    "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
                    "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
                    "dev": true,
                    "requires": {
                    "p-limit": "2.1.0"
                    }
                    },
                    "p-try": {
                    "version": "2.0.0",
                    "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
                    "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==",
                    "dev": true
                    },
                    "pkg-dir": {
                    "version": "3.0.0",
                    "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
                    "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
                    "dev": true,
                    "requires": {
                    "find-up": "3.0.0"
                    }
                    },
                    "pump": {
                    "version": "3.0.0",
                    "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
                    "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
                    "dev": true,
                    "requires": {
                    "end-of-stream": "1.4.1",
                    "once": "1.4.0"
                    }
                    },
                    "source-map": {
                    "version": "0.6.1",
                    "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
                    "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
                    "dev": true
                    },
                    "ssri": {
                    "version": "6.0.1",
                    "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
                    "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
                    "dev": true,
                    "requires": {
                    "figgy-pudding": "3.5.1"
                    }
                    },
                    "yallist": {
                    "version": "3.0.3",
                    "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
                    "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
                    "dev": true
                    }
                    }
                    }





                    share|improve this answer


























                      1












                      1








                      1







                      To resolve the angular prod build issue, we need to fix the version of terser and terser-webpack-plugin to 3.14.1 in the package-lock.json. Below is what my looks like. Finally the production build is working for me.



                        "terser": {
                      "version": "3.14.1",
                      "resolved": "https://registry.npmjs.org/terser/-/terser-3.14.1.tgz",
                      "integrity": "sha512-NSo3E99QDbYSMeJaEk9YW2lTg3qS9V0aKGlb+PlOrei1X02r1wSBHCNX/O+yeTRFSWPKPIGj6MqvvdqV4rnVGw==",
                      "dev": true,
                      "requires": {
                      "commander": "2.17.1",
                      "source-map": "0.6.1",
                      "source-map-support": "0.5.9"
                      },
                      "dependencies": {
                      "source-map": {
                      "version": "0.6.1",
                      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
                      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
                      "dev": true
                      }
                      }
                      },
                      "terser-webpack-plugin": {
                      "version": "1.1.0",
                      "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.1.0.tgz",
                      "integrity": "sha512-61lV0DSxMAZ8AyZG7/A4a3UPlrbOBo8NIQ4tJzLPAdGOQ+yoNC7l5ijEow27lBAL2humer01KLS6bGIMYQxKoA==",
                      "dev": true,
                      "requires": {
                      "cacache": "11.3.2",
                      "find-cache-dir": "2.0.0",
                      "schema-utils": "1.0.0",
                      "serialize-javascript": "1.6.1",
                      "source-map": "0.6.1",
                      "terser": "3.14.1",
                      "webpack-sources": "1.3.0",
                      "worker-farm": "1.6.0"
                      },
                      "dependencies": {
                      "cacache": {
                      "version": "11.3.2",
                      "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz",
                      "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==",
                      "dev": true,
                      "requires": {
                      "bluebird": "3.5.3",
                      "chownr": "1.1.1",
                      "figgy-pudding": "3.5.1",
                      "glob": "7.1.3",
                      "graceful-fs": "4.1.15",
                      "lru-cache": "5.1.1",
                      "mississippi": "3.0.0",
                      "mkdirp": "0.5.1",
                      "move-concurrently": "1.0.1",
                      "promise-inflight": "1.0.1",
                      "rimraf": "2.6.3",
                      "ssri": "6.0.1",
                      "unique-filename": "1.1.1",
                      "y18n": "4.0.0"
                      }
                      },
                      "find-cache-dir": {
                      "version": "2.0.0",
                      "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz",
                      "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==",
                      "dev": true,
                      "requires": {
                      "commondir": "1.0.1",
                      "make-dir": "1.3.0",
                      "pkg-dir": "3.0.0"
                      }
                      },
                      "find-up": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
                      "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
                      "dev": true,
                      "requires": {
                      "locate-path": "3.0.0"
                      }
                      },
                      "locate-path": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
                      "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
                      "dev": true,
                      "requires": {
                      "p-locate": "3.0.0",
                      "path-exists": "3.0.0"
                      }
                      },
                      "lru-cache": {
                      "version": "5.1.1",
                      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
                      "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
                      "dev": true,
                      "requires": {
                      "yallist": "3.0.3"
                      }
                      },
                      "mississippi": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
                      "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==",
                      "dev": true,
                      "requires": {
                      "concat-stream": "1.6.2",
                      "duplexify": "3.6.1",
                      "end-of-stream": "1.4.1",
                      "flush-write-stream": "1.0.3",
                      "from2": "2.3.0",
                      "parallel-transform": "1.1.0",
                      "pump": "3.0.0",
                      "pumpify": "1.5.1",
                      "stream-each": "1.2.3",
                      "through2": "2.0.5"
                      }
                      },
                      "p-limit": {
                      "version": "2.1.0",
                      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz",
                      "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==",
                      "dev": true,
                      "requires": {
                      "p-try": "2.0.0"
                      }
                      },
                      "p-locate": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
                      "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
                      "dev": true,
                      "requires": {
                      "p-limit": "2.1.0"
                      }
                      },
                      "p-try": {
                      "version": "2.0.0",
                      "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
                      "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==",
                      "dev": true
                      },
                      "pkg-dir": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
                      "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
                      "dev": true,
                      "requires": {
                      "find-up": "3.0.0"
                      }
                      },
                      "pump": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
                      "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
                      "dev": true,
                      "requires": {
                      "end-of-stream": "1.4.1",
                      "once": "1.4.0"
                      }
                      },
                      "source-map": {
                      "version": "0.6.1",
                      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
                      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
                      "dev": true
                      },
                      "ssri": {
                      "version": "6.0.1",
                      "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
                      "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
                      "dev": true,
                      "requires": {
                      "figgy-pudding": "3.5.1"
                      }
                      },
                      "yallist": {
                      "version": "3.0.3",
                      "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
                      "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
                      "dev": true
                      }
                      }
                      }





                      share|improve this answer













                      To resolve the angular prod build issue, we need to fix the version of terser and terser-webpack-plugin to 3.14.1 in the package-lock.json. Below is what my looks like. Finally the production build is working for me.



                        "terser": {
                      "version": "3.14.1",
                      "resolved": "https://registry.npmjs.org/terser/-/terser-3.14.1.tgz",
                      "integrity": "sha512-NSo3E99QDbYSMeJaEk9YW2lTg3qS9V0aKGlb+PlOrei1X02r1wSBHCNX/O+yeTRFSWPKPIGj6MqvvdqV4rnVGw==",
                      "dev": true,
                      "requires": {
                      "commander": "2.17.1",
                      "source-map": "0.6.1",
                      "source-map-support": "0.5.9"
                      },
                      "dependencies": {
                      "source-map": {
                      "version": "0.6.1",
                      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
                      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
                      "dev": true
                      }
                      }
                      },
                      "terser-webpack-plugin": {
                      "version": "1.1.0",
                      "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.1.0.tgz",
                      "integrity": "sha512-61lV0DSxMAZ8AyZG7/A4a3UPlrbOBo8NIQ4tJzLPAdGOQ+yoNC7l5ijEow27lBAL2humer01KLS6bGIMYQxKoA==",
                      "dev": true,
                      "requires": {
                      "cacache": "11.3.2",
                      "find-cache-dir": "2.0.0",
                      "schema-utils": "1.0.0",
                      "serialize-javascript": "1.6.1",
                      "source-map": "0.6.1",
                      "terser": "3.14.1",
                      "webpack-sources": "1.3.0",
                      "worker-farm": "1.6.0"
                      },
                      "dependencies": {
                      "cacache": {
                      "version": "11.3.2",
                      "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz",
                      "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==",
                      "dev": true,
                      "requires": {
                      "bluebird": "3.5.3",
                      "chownr": "1.1.1",
                      "figgy-pudding": "3.5.1",
                      "glob": "7.1.3",
                      "graceful-fs": "4.1.15",
                      "lru-cache": "5.1.1",
                      "mississippi": "3.0.0",
                      "mkdirp": "0.5.1",
                      "move-concurrently": "1.0.1",
                      "promise-inflight": "1.0.1",
                      "rimraf": "2.6.3",
                      "ssri": "6.0.1",
                      "unique-filename": "1.1.1",
                      "y18n": "4.0.0"
                      }
                      },
                      "find-cache-dir": {
                      "version": "2.0.0",
                      "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz",
                      "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==",
                      "dev": true,
                      "requires": {
                      "commondir": "1.0.1",
                      "make-dir": "1.3.0",
                      "pkg-dir": "3.0.0"
                      }
                      },
                      "find-up": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
                      "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
                      "dev": true,
                      "requires": {
                      "locate-path": "3.0.0"
                      }
                      },
                      "locate-path": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
                      "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
                      "dev": true,
                      "requires": {
                      "p-locate": "3.0.0",
                      "path-exists": "3.0.0"
                      }
                      },
                      "lru-cache": {
                      "version": "5.1.1",
                      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
                      "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
                      "dev": true,
                      "requires": {
                      "yallist": "3.0.3"
                      }
                      },
                      "mississippi": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
                      "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==",
                      "dev": true,
                      "requires": {
                      "concat-stream": "1.6.2",
                      "duplexify": "3.6.1",
                      "end-of-stream": "1.4.1",
                      "flush-write-stream": "1.0.3",
                      "from2": "2.3.0",
                      "parallel-transform": "1.1.0",
                      "pump": "3.0.0",
                      "pumpify": "1.5.1",
                      "stream-each": "1.2.3",
                      "through2": "2.0.5"
                      }
                      },
                      "p-limit": {
                      "version": "2.1.0",
                      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz",
                      "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==",
                      "dev": true,
                      "requires": {
                      "p-try": "2.0.0"
                      }
                      },
                      "p-locate": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
                      "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
                      "dev": true,
                      "requires": {
                      "p-limit": "2.1.0"
                      }
                      },
                      "p-try": {
                      "version": "2.0.0",
                      "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
                      "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==",
                      "dev": true
                      },
                      "pkg-dir": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
                      "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
                      "dev": true,
                      "requires": {
                      "find-up": "3.0.0"
                      }
                      },
                      "pump": {
                      "version": "3.0.0",
                      "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
                      "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
                      "dev": true,
                      "requires": {
                      "end-of-stream": "1.4.1",
                      "once": "1.4.0"
                      }
                      },
                      "source-map": {
                      "version": "0.6.1",
                      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
                      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
                      "dev": true
                      },
                      "ssri": {
                      "version": "6.0.1",
                      "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
                      "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
                      "dev": true,
                      "requires": {
                      "figgy-pudding": "3.5.1"
                      }
                      },
                      "yallist": {
                      "version": "3.0.3",
                      "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
                      "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
                      "dev": true
                      }
                      }
                      }






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Feb 3 at 3:20









                      sanjeevsanjeev

                      8114




                      8114























                          1














                          The above answers are correct. Terser plugin is required to downgrade to version 3.14.1. But here is the procedure for doing that :




                          1. Open package-lock.json file.

                          2. Replace the version of terser to 3.14.1. Refer this answer for where to make changes.

                          3. open cmd and run the command npm install terser@3.14.1.

                          4. Now you can run ng build --prod for production build.






                          share|improve this answer




























                            1














                            The above answers are correct. Terser plugin is required to downgrade to version 3.14.1. But here is the procedure for doing that :




                            1. Open package-lock.json file.

                            2. Replace the version of terser to 3.14.1. Refer this answer for where to make changes.

                            3. open cmd and run the command npm install terser@3.14.1.

                            4. Now you can run ng build --prod for production build.






                            share|improve this answer


























                              1












                              1








                              1







                              The above answers are correct. Terser plugin is required to downgrade to version 3.14.1. But here is the procedure for doing that :




                              1. Open package-lock.json file.

                              2. Replace the version of terser to 3.14.1. Refer this answer for where to make changes.

                              3. open cmd and run the command npm install terser@3.14.1.

                              4. Now you can run ng build --prod for production build.






                              share|improve this answer













                              The above answers are correct. Terser plugin is required to downgrade to version 3.14.1. But here is the procedure for doing that :




                              1. Open package-lock.json file.

                              2. Replace the version of terser to 3.14.1. Refer this answer for where to make changes.

                              3. open cmd and run the command npm install terser@3.14.1.

                              4. Now you can run ng build --prod for production build.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Feb 4 at 11:13









                              SankeerthSankeerth

                              316




                              316























                                  1














                                  For Angular prod build, this fixed it for me:



                                  npm install --save-exact --save terser@3.14





                                  share|improve this answer






























                                    1














                                    For Angular prod build, this fixed it for me:



                                    npm install --save-exact --save terser@3.14





                                    share|improve this answer




























                                      1












                                      1








                                      1







                                      For Angular prod build, this fixed it for me:



                                      npm install --save-exact --save terser@3.14





                                      share|improve this answer















                                      For Angular prod build, this fixed it for me:



                                      npm install --save-exact --save terser@3.14






                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Feb 8 at 9:58









                                      icc97

                                      6,49754062




                                      6,49754062










                                      answered Feb 4 at 11:13









                                      JieLiJieLi

                                      6912




                                      6912






























                                          draft saved

                                          draft discarded




















































                                          Thanks for contributing an answer to Stack Overflow!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54497782%2ferror-in-runtime-from-terser-during-build-prod%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Probability when a professor distributes a quiz and homework assignment to a class of n students.

                                          Aardman Animations

                                          Are they similar matrix