【问题标题】:brunch.io not handling compilation errorsbrunch.io 不处理编译错误
【发布时间】:2013-10-25 22:33:56
【问题描述】:

我创建了自己的 brunch 配置来使用 coffeescript、jade 和 stylus。

它运行良好,除了一个主要问题。每当coffeescript 或jade(还没有手写笔编码错误)在brunch --watch 期间编译时出现问题,我都会收到如下错误:

C:\path\to\node_modules\brunch\lib\fs_utils\pipeline.js:64
          return callback(throwError('Compiling', error));
                 ^
ReferenceError: callback is not defined
    at C:\path\to\node_modules\brunch\lib\fs_utils\pipeline.js:64:18
    at CoffeeScriptCompiler.module.exports.CoffeeScriptCompiler.compile (C:\path\to\node_modules\coffee-script-brunch\lib\index.js:56:16)
    at C:\path\to\node_modules\brunch\lib\fs_utils\pipeline.js:93:31
    at fn (C:\path\to\node_modules\brunch\node_modules\async-waterfall\index.js:19:24)
    at Object._onImmediate (C:\path\to\chromesign\node_modules\brunch\node_modules\async-waterfall\index.js:58:22)
    at processImmediate [as _immediateCallback] (timers.js:330:15)

看起来应该向插件传递一个错误回调,但它没有发生?

我在配置中做错了吗?带有所有配置的骨架托管在on GitHub。对于这是否是我这边的问题,我将不胜感激!

谢谢!

【问题讨论】:

    标签: brunch


    【解决方案1】:

    当您生成此错误时,您似乎从 git master 分支安装了 brunch。我无法使用 v1.7.10 重现它。在 master 上(我 能够重现它),它刚刚被 https://github.com/brunch/brunch/commit/68dd9c9b6284c05a4eb01050dba56f80f978e35a 修复。因此,如果您现在重新安装 brunch,无论是最新版本 (1.7.10) 还是来自 git master 的边缘版本,您报告的问题应该会消失。

    此外,您可能需要重新考虑在 package.json 中让 brunch 成为您的骨架的依赖项。除非有特殊原因,否则最好让它在全球范围内安装。如果您想向用户说明您的骨架只能用于 >=1.7 的早午餐版本,您可以在自述文件中说明。

    【讨论】:

    • 谢谢!我回家后看看:)
    • 我在本地卸载了 brunch 并将其从 package.json 中删除,然后运行 ​​npm install brunch -g。我仍然有错误,所以我使用npm install brunch/brunch -g 解决了这个问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多