srod/node-minify

Cannot read property 'contexts' of null

JeffML opened this issue · 2 comments

getting the following error:

node minify
minify temp dir is /tmp
TypeError: unknown: Cannot read property 'contexts' of null

minify is a script I wrote; snippet:

let compressor = require('node-minify'),
  os = require('os');

const minify = (options, callback) => {
  const jsCompress = options.compress ? 'babel-minify' : 'no-compress'; // Using UglifyJS Compressor for JS
...
  Promise.all([
    compressor.minify({
      compressor: jsCompress,
      tempPath: fullTmpDir,
      input: [
        `${JS_SRCPATH}app.js`,
        `${JS_SRCPATH}common.js`,
        `${JS_SRCPATH}atlee.js`,
        `${JS_SRCPATH}shims.js`,
        `${JS_SRCPATH}search.js`,
        `${JS_SRCPATH}products/sampleRequest.js`,
      ],
      output: `${JS_SRCPATH}min/baseScripts.min.js`,
    }),
    ...
]);

I found this listed as a workaround, but haven't tried implementing it yet:
babel/minify#933

srod commented

Hey @JeffML, sorry for the delay.
Did you still have your bug ? Because I just tried your code, and I can't reproduce the error.