2017-01-27 32 views
2

當我運行企圖捆綁我的應用程序:陣營本地捆綁:語法錯誤:意外的令牌:運算符(*)

react-native bundle --platform ios --dev false \ 
    --entry-file index.ios.js --bundle-output iOS/main.jsbundle 

我碰到下面的錯誤,沒有其他細節:

SyntaxError: Unexpected token: operator (*) 

對於它的價值,這個工程(含--dev true):

react-native bundle --platform ios --dev true \ 
    --entry-file index.ios.js --bundle-output iOS/main.jsbundle 

我最好的猜測是,這個問題是一些其中,在UglifyJS一步,也許涉及:

https://github.com/mishoo/UglifyJS2/issues/1199

任何提示嗎?歡迎您提供更深入挖掘的建議!謝謝!

回答

5

我們發現與行號:

./node_modules/.bin/esvalidate --formatter=sublime.js ios/main.jsbundle 

的問題是使用** ES6運算符。恢復爲Math.pow()

+0

在我的情況下** main.jsbundle **由於在ESLint提示時用**運算符替換** Math.pow **失敗。捆綁錯誤是**意外的標記:運算符(*)**。 如果沒有** main.jsbundle **來運行** esvalidate **,有沒有辦法找到行號?就我而言,我懷疑這個問題,正則表達式找到了它。 ** react-native bundle **有** verbose **選項嗎? –

相關問題