对于项目文件夹中的任何.styl文件,Stylus输出是
Cannot set property 'lineno' of undefined
at Lexer.advance (C:\Projects\my-project\node_modules\stylus\lib\lexer.js:229:16)
at Lexer.lookahead (C:\Projects\my-project\node_modules\stylus\lib\lexer.js:119:46)
at Lexer.peek (C:\Projects\my-project\node_modules\stylus\lib\lexer.js:242:17)
at Parser.peek (C:\Projects\my-project\node_modules\stylus\lib\parser.js:324:23)
at Parser.accept (C:\Projects\my-project\node_modules\stylus\lib\parser.js:272:22)
at Parser.selector (C:\Projects\my-project\node_modules\stylus\lib\parser.js:1538:12)
at Parser.stmt (C:\Projects\my-project\node_modules\stylus\lib\parser.js:778:26)
at Parser.statement (C:\Projects\my-project\node_modules\stylus\lib\parser.js:685:21)
at Parser.block (C:\Projects\my-project\node_modules\stylus\lib\parser.js:852:21)
at Parser.selector (C:\Projects\my-project\node_modules\stylus\lib\parser.js:1555:24)
at Parser.stmt (C:\Projects\my-project\node_modules\stylus\lib\parser.js:778:26)
at Parser.statement (C:\Projects\my-project\node_modules\stylus\lib\parser.js:685:21)
at Parser.block (C:\Projects\my-project\node_modules\stylus\lib\parser.js:852:21)
at Parser.selector (C:\Projects\my-project\node_modules\stylus\lib\parser.js:1555:24)
at Parser.stmt (C:\Projects\my-project\node_modules\stylus\lib\parser.js:778:26)
at Parser.statement (C:\Projects\my-project\node_modules\stylus\lib\parser.js:685:21)
我正在使用命令运行Stulus:stylus -w filename.styl -o style.css
Stylus版本为0.54.5。
这可能是什么原因?
答案 0 :(得分:0)
经过一番挖掘后,我发现我的.styl文件之一是UTF-16而不是UTF-8。 我将编码改为UTF-8,它解决了这个问题。