0

Usually with Emacs errors are syntax related. This one seems anyway a bit obscure.

On windows 10 installed sass-dart with chocolaty.

choco install sass

Note: at much earlier time installed sass-node globally, and then at the same much earlier time installed sass-node into directory with npm install sass-node -D, then removed the sass-node global installation. At time of error, there's no sass on windows path variable. This should be irrelevant.

Added scss-mode from melpa and configure as such:

(use-package scss-mode
 :commands (scss-mode scss-compile)
 :mode ("\\.scss" . scss-mode)
 :config
   (require 'scss-mode)
   ;;(setq scss-sass-command "C:/ProgramData/chocolatey/lib/sass/tools/sass.bat")
   ;;(setq exec-path (cons (expand-file-name "C:/ProgramData/chocolatey/bin/sass.exe") exec-path))
   (setq scss-compile-at-save 'nil)
   ;;(autoload 'scss-mode "scss-mode")
);end scss-mode

I get the same error using the setq scss-sass-command, the setq exec-path, switching the program paths in the same two lines (sass.bat and sass.exe), using both of them or neither of them.

"sass  'c:/Users/Username/Desktop/wd/sass-test.scss' 'c:/Users/Username/Desktop/wd/sass-test.css'
Duplicate source "'c"."

Duplicate source error. What is this error? What is the c in it? How to fix it?

I suspect Emacs runs somewhere into the option of using one or another sass executable, though I shouldn't know where it's getting the second one (the one not specified in the init file). Is it somehow accessing node-sass from a local npm package directory? That seems unlikely.

In any case, when I run sass directly from the command line, or from an Emacs wrapper on the command line, it works no problem. It just won't compile from scss-mode.

Also, and possibly relevant? Chocolatey won't upgrade dart-sass. It gives this error:

" - dart-sdk (exited 1) - dart-sdk not upgraded. An error occurred during installation:
 Updating 'dart-sdk 2.7.0' to 'dart-sdk 2.8.1' failed. Unable to find a version of 'sass' that is compatible with 'dart-sdk 2.8.1'."

Should I dump dart-sass like yesterday's news and go back to libSass via node?

0

I've never used sass-dart, but this looks like an error having to do with filenames and paths on Windows.

You're configuring it to run a command that looks file sass file1.scss file2.scss, but with full path names. However, those path names are not using the normal Windows syntax, which looks like C:\foo\bar\file1.scss; instead you're giving it c:/foo/bar/file1.scss. I suspect that this is confusing the scss program, it the error message that it spits out is simply not very helpful. Combined with the misparsing of the filenames, it becomes downright gnomic; it thinks both files are just named "c".

It may be that this package simply doesn't work on Windows (yet), or it may be that by setting scss-sass-command you've overridden the part of the code that handles the paths correctly. Also, exec-path should have the path containing the binary in it, not the full name of the binary itself. You've got that commented out, probably because it didn't work as written. Thirdly, you don't need to use (require 'foo) when you want to set variables that are defined in a package; Emacs can handle that gracefully without loading the full package first (this won't cause it to fail, it's just marginally slower than it could be).

I suspect that if you remove your setting for scss-sass-command and fix the one that sets exec-path, it may just start working. But you might need to talk to whoever wrote the package and see if they've tested it on Windows.

| improve this answer | |
  • Thanks. The paths are following the convention that works for the rest of my very many packages, but I know what you mean. It looks like emacs ran into two options for the same program and spat out an error message, which is a good thing to do at that point. I just didn't bother compiling the scss from scss-mode and compiled instead from the shell, and then afteward automatically using npm's 'onchange.' It probably is very much a windows thing. – F. Certainly. Jun 26 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.