excubo-ag / WebCompiler

Apache License 2.0
149 stars 30 forks source link

LibSassHost.SassCompilerLoadException on Linux #26

Closed bdovaz closed 3 years ago

bdovaz commented 3 years ago

I have the following problem:

11:15:43 Unhandled exception. LibSassHost.SassCompilerLoadException: During loading of Sass compiler error has occurred. Most likely it happened, because the 'libsass.so' assembly or one of its dependencies was not found. Try to install the LibSassHost.Native.linux-x64 package via NuGet. ---> System.DllNotFoundException: Unable to load shared library 'libsass' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibsass: cannot open shared object file: No such file or directory 11:15:43 at LibSassHost.Internal.Native.Sass_Api.libsass_version() 11:15:43 at LibSassHost.Internal.SassCompilerProxy.GetVersion() 11:15:43 at LibSassHost.SassCompiler.Initialize() 11:15:43 at LibSassHost.SassCompiler.Initialize() 11:15:43 at LibSassHost.SassCompiler.CompileFile(String inputPath, String outputPath, String sourceMapPath, CompilationOptions options) 11:15:43 at WebCompiler.Compile.SassCompiler.Compile(List``1 file_sequence) in C:\Users\Stefan Lörwald\DEV\libraries\web_compiler\WebCompiler\WebCompiler\Compile\SassCompiler.cs:line 42 11:15:43 at WebCompiler.Compile.CompilationStep.With(Compiler compiler) in C:\Users\Stefan Lörwald\DEV\libraries\web_compiler\WebCompiler\WebCompiler\Compile\CompilationStep.cs:line 19 11:15:43 at WebCompiler.Compile.Compilers.TryCompile(String file) in C:\Users\Stefan Lörwald\DEV\libraries\web_compiler\WebCompiler\WebCompiler\Compile\Compilers.cs:line 34 11:15:43 at WebCompiler.Program.Main(String[] args) in C:\Users\Stefan Lörwald\DEV\libraries\web_compiler\WebCompiler\WebCompiler\Program.cs:line 192

stefanloerwald commented 3 years ago

This is a problem I've seen before on alpine. Are you by any chance using that?

In that case, I'd recommend steering away from that distribution for the purposes of compilation tasks: It is intended to keep image size low, but that's not a concern for compilation steps (as only the compilation output needs to end up in a "slim" image).

If not, this is still an issue with the linux distribution, not with WebCompiler, or LibSassHost for that matter. For all I know the error hints at missing dependencies, but the only dependency it lists is a false positive.

bdovaz commented 3 years ago

I have switched to Debian and it worked perfectly.

It would be nice to document or detect in which cases it can happen to at least help a little.

stefanloerwald commented 3 years ago

I'm glad that this resolved your issue!

I've added a paragraph about this here, to help future users not to run into the same issue: https://github.com/excubo-ag/WebCompiler#docker