試圖上傳至銀河編譯當流星UglifyJS錯誤導致的錯誤,所以我與調試以下內容:試圖生產
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';
自從t以來仍然無法弄清楚問題是什麼帽子是流星在他們的文檔中建議的語法。刪除standard-minifier-js
包可解決問題,但這不是解決問題的最佳方式,所以我希望有一個解決方案!
您是否在項目中包含ecmascript或babel包? – Mikkel
您的應用程序是否在沒有'--production'的情況下運行? – Khang
@Khang,是的,這是因爲'standard-minifiers-js'軟件包只能在生產捆綁中使用,例如部署到Galaxy或使用'--production'運行 – sdybskiy