更改react fullstack中的文件时发生Jade Run错误



我已经和yeoman开始了一个react全栈项目。有一个观察程序,当我对玉文件进行更改时,它会更新玉文件,而不会保存。正如你所能想象的,我的控制台看起来是这样的:

[BS] File changed: build/content/index.jade
[BS] File changed: build/content/index.jade
[BS] File changed: build/content/index.jade
[BS] File changed: build/content/index.jade
[BS] File changed: build/content/index.jade
[BS] File changed: build/content/index.jade
[BS] File changed: build/content/index.jade
[BS] File changed: build/content/index.jade
[BS] File changed: build/content/index.jade
[BS] File changed: build/content/index.jade

然而,无论何时进行更改,Webstorm 10:的Run部分都会出现错误

/usr/local/bin/jade index.jade
/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:939
  throw err;
  ^
SyntaxError: Assigning to rvalue (5:0)
    at Parser.pp.raise (/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:937:13)
    at Parser.pp.checkLVal (/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:1216:12)
    at Parser.pp.parseMaybeUnary (/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:193:22)
    at Parser.pp.parseExprOps (/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:152:19)
    at Parser.pp.parseMaybeConditional (/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:134:19)
    at Parser.pp.parseMaybeAssign (/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:112:19)
    at Parser.pp.parseExpression (/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:86:19)
    at Parser.pp.parseStatement (/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:1728:23)
    at Parser.pp.parseTopLevel (/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:1644:21)
    at Parser.parse (/usr/local/lib/node_modules/jade/node_modules/acorn/dist/acorn.js:1614:17)
Process finished with exit code 1

每当文件更改时,Run(运行)窗口中就会弹出此消息,但它似乎不会导致更新文件的实际问题。

你经历过这个错误吗?如何防止出现此错误,以及为什么它与acorn.js有关?

您应该从位于*.jade文件开头的代码中删除---

例如,你可以在index.jade:中看到它

---
title: React.js Starter Kit
component: ContentPage
---
div.row
  div.col-sm-4
h3 Runtime Components
dl

最新更新