Search code examples
javascriptmeteordeploymentmeteor-up

Meteor Up deploy failed but app runs fine in development


I am testing deployment of my first Meteor app, and thought using Meteor Up. After fiddling around much, I managed to run mup setup without any errors and everything seems fine.

However, running mup deploy fails :

$ mup deploy
Building App Bundle Locally
Errors prevented bundling:
While minifying app code:
eval at <anonymous>
(/home/yanick/.meteor/packages/standard-minifier-js/.1.2.1.s85ddv++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:1545:18: SyntaxError: Unexpected token: name (Converter)
at new JS_Parse_Error (eval at <anonymous>
(/home/yanick/.meteor/packages/standard-minifier-js/.1.2.1.s85ddv++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:1545:18) at js_error (eval at <anonymous>
...

The faulty file seems to be a Converter.js, but this file is nothing fancy and simply exports some JSON object :

import Converter from 'universal-converter';

export default Converter;

export const DEFAULT_UNIT = 'unit';

export const Units = {
  'unit': {
    'type': 'unit',
    'name': 'unit'
  },
  'inch': {
    'type': 'distance',
    'name': 'inch',
    'label': 'in'
  },
  'inch2': {
    'type': 'area',
    'name': 'square inch',
    'label': 'in²'
  },
  'foot': {
    'type': 'distance',
    'name': 'foot',
    'label': 'ft'
  },
  'foot2': {
    'type': 'area',
    'name': 'square foot',
    'label': 'ft²'
  },
  'yard': {
    'type': 'distance',
    'name': 'yard',
    'label': 'yd'
  },
  'yard2': {
    'type': 'area',
    'name': 'square yard',
    'label': 'yd²'
  },
  'cm': {
    'type': 'distance',
    'name': 'centimeter',
    'label': 'cm'
  },
  'm': {
    'type': 'distance',
    'name': 'meter',
    'label': 'm'
  },
  'g': {
    'type': 'mass',
    'name': 'gram',
    'label': 'g'
  },
  'kg': {
    'type': 'mass',
    'name': 'kilogram',
    'label': 'kg'
  },
  'lb' : {
    'type': 'mass',
    'name': 'pound',
    'label': 'lb'
  },
  'oz': {
    'type': 'mass',
    'name': 'once [France]',
    'label': 'oz'
  },
  'liter': {
    'type': 'volume',
    'name': 'liter',
    'label': 'L'
  },
  'gal': {
    'type': 'volume',
    'name': 'gallon [US, liquid]',
    'label': 'Gal'
  },
  'oz_v': {
    'type': 'volume',
    'name': 'ounce [UK, liquid]',
    'label': 'oz'
  }
};

Why is meteor running fine, but creating a bundle of the application fail?


Update 1

I have tried refactoring my app directories, moving the build around, nothing changes. This command : meteor build ../output (where the path is outside the root folder of my project) fails as described above.


Solution

  • Please take a look to the related issue on Github. In this page, @Abernix found a temporary solution:

    at root of your project, do theses command line:

    meteor remove standard-minifier-js
    
    meteor add abernix:[email protected]
    

    And then, try again to build.

    WARNING: As @Abernix said:

    Please don't consider this as a long-term solution (as it will be better if you remain on the official package), but more of a survey to see how their progress is is going. There is still work to be done before it's finished, but I'm curious if it fixes it for any of you. My package is using the 2.7.5 release of the uglify-js harmony branch (which is still not considered stable, but might work for some).