Meteor Up部署失败,但app在开发中运行良好 [英] Meteor Up deploy failed but app runs fine in development

查看:196
本文介绍了Meteor Up部署失败,但app在开发中运行良好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试我的第一个Meteor应用程序的部署,并想到使用Meteor Up。在摆弄了很多之后,我设法运行 mup setup 而没有任何错误,一切似乎都很好。

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.

然而,正在运行 mup deploy 失败:

$ 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>
...

错误的文件似乎是 Converter.js ,但这个文件没什么特别的,只是导出一些JSON对象:

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'
  }
};

为什么 meteor 运行良好,但创建一捆申请失败?

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

我尝试重构我的应用程序目录,移动构建,没有任何变化。此命令: meteor build ../ output (其中路径位于我项目的根文件夹之外)如上所述失败。

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.

推荐答案

请查看相关的 Github上的问题
在这个页面中,@ Abernix找到了一个临时解决方案:

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:standard-minifier-js@1.2.2

然后,再次尝试构建。

警告:正如@Abernix所说:

WARNING: As @Abernix said:


请不要将此视为长期解决方案(因为它会更好,如果你还留在正式的包装上),但更多的调查是为了了解他们的进展如何。在它完成之前仍有工作要做,但我很好奇它是否能为你们中的任何人修复它。我的软件包正在使用uglify-js和谐分支的2.7.5版本(它仍然不被认为是稳定的,但可能适用于某些)。

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).

这篇关于Meteor Up部署失败,但app在开发中运行良好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆