尝试上传到Galaxy导致错误,所以我正在调试以下内容:
meteor --settings settings-dev.json --production
While minifying app code:
eval at <anonymous>
(/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++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: punc ())
at new JS_Parse_Error (eval at <anonymous>
(/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++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>
(/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:1553:11)
at croak (eval at <anonymous>
(/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2089:9)
at token_error (eval at <anonymous>
(/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2097:9)
at unexpected (eval at <anonymous>
(/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2103:9)
at expr_atom (eval at <anonymous>
(/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2618:13)
at maybe_unary (eval at <anonymous>
(/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2792:19)
at expr_ops (eval at <anonymous>
(/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2827:24)
at maybe_conditional (eval at <anonymous>
(/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2832:20)
* Many more lines of same kind of stuff*
=> Your application has errors. Waiting for file change.
这真的没有给出导致问题的原因。 GitHub上有running issue但到目前为止还没有进展。
我试图深入挖掘并在我的终端中做了以下事情
alias uglifyjs=~/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/bin/uglifyjs
find lib client -type f -name \*.js|while read file;do uglifyjs -o /dev/null $file;done
返回
Parse error at client/main.js:1,7
SyntaxError: Unexpected token: string (/imports/startup/client)
Error
at new JS_Parse_Error (eval at <anonymous> (/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++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> (/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1553:11)
at croak (eval at <anonymous> (/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2089:9)
at token_error (eval at <anonymous> (/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2097:9)
at unexpected (eval at <anonymous> (/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2103:9)
at semicolon (eval at <anonymous> (/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2123:56)
at simple_statement (eval at <anonymous> (/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2314:73)
at eval (eval at <anonymous> (/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2183:19)
at eval (eval at <anonymous> (/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2136:24)
at eval (eval at <anonymous> (/Users/sergiy/.meteor/packages/standard-minifier-js/.1.2.1.1ldi2wj++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2904:23)
我的main.js
文件如下所示:
import '/imports/startup/client';
仍然无法弄清楚问题是什么,因为这是Meteor在他们的文档中提出的语法。删除standard-minifier-js
软件包修复了问题,但这不是解决问题的最佳方法,所以我希望有一个修复程序!
答案 0 :(得分:0)
自2.7.5以来,UglifyJS一直没有和谐支持。
在https://github.com/mishoo/UglifyJS2上有一个和谐和和谐-v2.7.5分支。迄今为止,对模块的支持还没有完全实现,和谐支持仍然是实验性的,尽管已经实现了许多功能。
答案 1 :(得分:0)
原来我的一个组件导入的NPM包(ClipboardJS)存在问题。删除它并将脚本添加到我的<head></head>
修复了该问题。我宁愿使用外部src
而非非缩小应用的缩小应用。