在react-fullstack中更改文件时出现Jade Run错误

时间:2015-11-07 22:50:02

标签: reactjs pug yeoman

我和自耕农一起开始了一个反应充实的项目。有一个观察者在我对其进行更改时更新了玉文件,而没有我保存。我的控制台看起来像这样,你可以想象:

[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

每当文件发生更改时,都会在“运行”窗口中弹出此消息,但这似乎不会导致更新文件时出现实际问题。

您是否遇到过此错误?如何防止出现此错误,为什么它与acorn.js有关?

1 个答案:

答案 0 :(得分:2)

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

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



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