直到昨天Sass工作正常,现在,Sass不再编译我的SCSS文件了。
这是我到目前为止所尝试的内容,但没有解决问题:
技术信息:
sass --watch scss:css --style compact --compass --debug-info
其他信息:
发生的奇怪事情是,如果我在.scss
文件中写了不正确的内容,例如像#f00a
这样的颜色的四位十六进制值,然后运行--watch
,则立即生成Sass检测到问题,并使用错误重写.css
文件。
这意味着Sass在某种程度上是部分工作的。
输入所有--watch
命令后,Sass通常会说:>>> Sass is watching for changes. Press Ctrl-C to stop.
但是,当我保存.scss
文件时,Sass不再编译。它就在那里。
Sass刚刚停止编译,还有其他人遇到过这个问题吗?
现在我不能继续处理我的项目了,因为再也无法创建CSS文件了,所以对此有任何帮助都非常感激。
感谢。
- UPDATE
我仍然无法编译。
然而,在停止--watch
后,我在我的CMD中获得了大量项目。在我的家用电脑Sass工作正常,当我停止--watch
我没有得到任何像这样或任何一个列表:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
c:\...\www>sass --watch scss:css --style compact --compass --debug-info --trace
>>> Sass is watching for changes. Press Ctrl-C to stop.
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/util/multibyte_string_sc anner.rb:36:in `scan': Interrupt from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/util/multibyte_string_scanner.rb:36:in `scan'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:1142:in `tok'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:865:in `value!'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:845:in `declaration'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:568:in `block in declaration_or_ruleset'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:1090:in `block in catch_error'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:1090:in `catch'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:1090:in `catch_error'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:567:in `declaration_or_ruleset'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:540:in `block_child'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:532:in `block_contents'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:521:in `block'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:515:in `ruleset'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:539:in `block_child'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:532:in `block_contents'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:70:in `stylesheet'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/scss/parser.rb:27:in `parse'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/engine.rb:342:in `_to_tree'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/engine.rb:315:in `_render'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/engine.rb:262:in `render'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/plugin/compiler.rb:341:in `update_stylesheet'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/plugin/compiler.rb:203:in `block in update_stylesheets'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/plugin/compiler.rb:201:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/plugin/compiler.rb:201:in `update_stylesheets'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/plugin/compiler.rb:235:in `watch'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/plugin.rb:107:in `method_missing'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/exec.rb:444:in `watch_or_update'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/exec.rb:307:in `process_result'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/exec.rb:41:in `parse'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/lib/sass/exec.rb:21:in `parse!'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.3/bin/sass:8:in `<top(required)>'
from C:/Ruby193/bin/sass:23:in `load'
from C:/Ruby193/bin/sass:23:in `<main>'
Terminate batch job (Y/N)?
CSS解析器有什么问题吗?
答案 0 :(得分:17)
我遇到过类似的问题,但是使用Sass和Compass。幸运的是,我设法通过运行compass clean
命令来解决问题,该命令删除了.sass-cache
文件和已编译的.css文件。然后再次运行compass --watch
命令。希望这可以帮助别人。
答案 1 :(得分:5)
不可否认,这对我来说非常愚蠢,但它恰好是我遇到这个堆栈溢出Q&amp; A时遇到的问题。
这是我非常简单问题的简单答案:
确保您在主style.scss文件中@importing该文件。
显然不是你这个非常复杂的问题的答案,但它可能会帮助一些与我处于类似位置的新手!
答案 2 :(得分:4)
我发现了问题:我的/ scss文件夹中的一个.scss文件导致Sass停止编译。
&#34;有问题&#34; file是项目主要.scss文件的旧副本,但是当我将旧版本与最新版本进行比较时,我只看到了属性,值和媒体查询方面的一些差异。代码。
除此之外,两者都有问题&#34;和&#34;纠正/工作&#34;文件几乎完全相同98%。
在GitHub的项目问题列表中阅读更广泛的答案:https://github.com/nex3/sass/issues/362#issuecomment-11255429