当捆绑我一直在处理的主题时,模板一直抛出一个错误,导致它无法完成捆绑。我真的不知道该怎么办了。
这是来自控制台日志的控制台日志:
E:\stencil>stencil bundle Validating theme... Running ESLint...
E:\stencil\assets\js\theme\common\carousel.js 22:159 error Parsing error: Adjacent JSX elements must be wrapped in an enclosing tag
E:\stencil\assets\js\theme\common\product-details.js 300:15 warning Function 'updateView' has a complexity of 13 complexity
✖ 2 个问题(1 个错误,1 个警告)
C:\Users\Kyle\AppData\Roaming\npm\node_modules\@bigcommerce\stencil-cli\lib\stencil-bundle.js:255 throw err; ^ Error: Please fix the above Javascript errors. at runLintTask (C:\Users\Kyle\AppData\Roaming\npm\node_modules\@bigcommerce\stencil-cli\lib\bundle-validator.js:268:18) at C:\Users\Kyle\AppData\Roaming\npm\node_modules\@bigcommerce\stencil-cli\node_modules\async\lib\async.js:718:13 at Immediate.iterate [as _onImmediate] (C:\Users\Kyle\AppData\Roaming\npm\node_modules\@bigcommerce\stencil-cli\node_modules\async\lib\async.js:262:13) at processImmediate [as _immediateCallback] (timers.js:367:17)
E:\stencil>
最佳答案
看起来 ESLint 不喜欢你的一些 JS。您可以尝试降低 .eslintrc 文件中的规则,甚至完全删除该文件,因为没有必要。
文件删除后,请再次尝试捆绑。
有关 eslint 的更多信息 here .
关于javascript - 如何解决模板包错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39174275/