gulp-babel在评论中显示语法错误

时间:2019-03-27 15:11:16

标签: webpack gulp gulp-babel

我在开发Foss工具方面提供了帮助,但是在Fedora29上大口小口。其他开发人员使用基于debian的系统,似乎还可以。 之前版本的Fedora没问题

gulp文件为at github,似乎gulp-babel在评论中抛出了SyntaxError:

[15:02:50] SyntaxError in plugin "run-sequence(babelify)"
Message:
    /var/www/master/assets/packages/adminbasics/build/adminbasics.js: Unexpected token (26258:37)
Details:
    pos: 811003
    loc: [object Object]
    _babel: true
    codeFrame:   26256 | 
  26257 |           if (context.method === "throw") {
> 26258 |             // If maybeInvokeDelegate
        |                                      ^
    fileName: /var/www/master/assets/packages/adminbasics/build/adminbasics.js

这是gulp默认值的完整结果

[adminbasics]$ gulp --no-color default
[15:02:42] Using gulpfile /var/www/master/assets/packages/adminbasics/gulpfile.js
[15:02:42] Starting 'default'...
[15:02:42] Starting 'compile:production'...
[15:02:42] Starting 'sass:production'...
[15:02:42] Starting 'webpack:production'...
[15:02:42] Finished 'sass:production' after 154 ms
[15:02:42] Version: webpack 3.12.0
             Asset     Size  Chunks                    Chunk Names
    adminbasics.js   871 kB       0  [emitted]  [big]  main
adminbasics.js.map  1.12 MB       0  [emitted]         main
[15:02:42] Finished 'webpack:production' after 894 ms
[15:02:42] Starting 'compress'...
[BABEL] Note: The code generator has deoptimised the styling of "/var/www/master/assets/packages/adminbasics/build/adminbasics.js" as it exceeds the max of "500KB".
[15:02:49] Finished 'compress' after 6.85 s
[15:02:49] Starting 'compresslibs'...
[15:02:49] Finished 'compresslibs' after 4.19 ms
[15:02:49] Finished 'compile:production' after 7.75 s
[15:02:49] Starting 'sass'...
[15:02:49] Starting 'webpack'...
[15:02:49] Starting 'babelify'...
[15:02:49] Finished 'sass' after 59 ms
[15:02:50] Version: webpack 3.12.0
             Asset     Size  Chunks                    Chunk Names
    adminbasics.js   871 kB       0  [emitted]  [big]  main
adminbasics.js.map  1.12 MB       0  [emitted]         main
[15:02:50] 'babelify' errored after 889 ms
[15:02:50] SyntaxError in plugin "gulp-babel"
Message:
    /var/www/master/assets/packages/adminbasics/build/adminbasics.js: Unexpected token (26258:37)
[15:02:50] 'default' errored after 8.65 s
[15:02:50] SyntaxError in plugin "run-sequence(babelify)"
Message:
    /var/www/master/assets/packages/adminbasics/build/adminbasics.js: Unexpected token (26258:37)
Details:
    pos: 811003
    loc: [object Object]
    _babel: true
    codeFrame:   26256 | 
  26257 |           if (context.method === "throw") {
> 26258 |             // If maybeInvokeDelegate
        |                                      ^
    fileName: /var/www/master/assets/packages/adminbasics/build/adminbasics.js

Stack:
SyntaxError: /var/www/master/assets/packages/adminbasics/build/adminbasics.js: Unexpected token (26258:37)
  26256 | 
  26257 |           if (context.method === "throw") {
> 26258 |             // If maybeInvokeDelegate
        |                                      ^
    at Parser.pp$5.raise (/var/www/master/assets/packages/adminbasics/node_modules/babylon/lib/index.js:4454:13)
    at Parser.pp.unexpected (/var/www/master/assets/packages/adminbasics/node_modules/babylon/lib/index.js:1761:8)
    at Parser.pp$3.parseExprAtom (/var/www/master/assets/packages/adminbasics/node_modules/babylon/lib/index.js:3750:12)
    at Parser.pp$3.parseExprSubscripts (/var/www/master/assets/packages/adminbasics/node_modules/babylon/lib/index.js:3494:19)
    at Parser.pp$3.parseMaybeUnary (/var/www/master/assets/packages/adminbasics/node_modules/babylon/lib/index.js:3474:19)
    at Parser.pp$3.parseExprOps (/var/www/master/assets/packages/adminbasics/node_modules/babylon/lib/index.js:3404:19)
    at Parser.pp$3.parseMaybeConditional (/var/www/master/assets/packages/adminbasics/node_modules/babylon/lib/index.js:3381:19)
    at Parser.pp$3.parseMaybeAssign (/var/www/master/assets/packages/adminbasics/node_modules/babylon/lib/index.js:3344:19)
    at Parser.pp$3.parseExpression (/var/www/master/assets/packages/adminbasics/node_modules/babylon/lib/index.js:3306:19)
    at Parser.pp$1.parseStatement (/var/www/master/assets/packages/adminbasics/node_modules/babylon/lib/index.js:1906:19)
[15:02:50] Finished 'webpack' after 905 ms

我的版本

$ gulp -v
[16:09:58] CLI version 2.0.1
[16:09:58] Local version 3.9.1

感谢任何人都可以提供建议。

0 个答案:

没有答案