Steve Bennett
Steve Bennett

Reputation: 126205

How to investigate vague "js/chunk-venders... from Terser" undefined failure?

My Vue-CLI project is failing to create a production build:

⠏  Building for production...

 ERROR  Failed to compile with 1 errors                                                                                                       21:21:03

 error  

js/chunk-vendors.fd39f4a0.js from Terser
undefined

 ERROR  Build failed with errors.

I can get it to build by disabling Terser. What is quite weird is that I have used this project template many times before, and am not doing anything particularly different in this project (a couple of slightly different modules, but exactly the same build process etc as usual).

In this similar question the output contained a line number which could be used for debugging, but mine doesn't. All I know is that something is undefined.

Google searches suggest that rolling back to specific Terser versions, but:

  1. I have terser-webpack-plugin 1.2.1 and terser 3.14.1 which seem to be the recommended ones; and
  2. These versions have been working for dozens of similar projects.

With a bit of trial and error I have now deduced that the problems lie with importing the module mapbox-gl-draw-circle, but my question remains:

How do you actually investigate (and fix, rather than simply workaround) a problem like this with Terser?

Upvotes: 2

Views: 699

Answers (0)

Related Questions