-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use DartSassHost in local dotnet tool #4
Comments
Hello, Sergey! I have tested your package on different operating systems. On Windows 10 (x64) everything works: On Ubuntu 20.04 (x64) everything works too: A well-known bug did not allow testing on macOs 10.13. But I rebuilt your package with a dependency on the JavaScriptEngineSwitcher.Jint version 3.16.0 Preview (works correctly only under .NET 5+) instead of the JavaScriptEngineSwitcher.V8, and everything works too: Unfortunately, it is no possibility yet to test the package on macOs 12. |
Hello Andrey! |
For now, I recommend you to check how the Excubo.WebCompiler version 3.0.1 Preview 2 works on macOS 12.1. |
@Taritsyn the same result with |
Then I recommend that you try to build your own package based on Jint. |
So, is that right that it is not going to be fixed? |
Must first understand whether the modification with Jint works on your machine. |
Can you show me the contents of |
|
It's good that it's not empty ;-) With an empty file, this error is reproduced completely: In general, what's stopping you from using the Node.js-version of this tool from Google? |
In general, the team does not want to install Node tool to be able to build the project, but if it won't work that's the still option. |
Hello, Sergey! Today I had the opportunity to run your original example on macOS 12.1 (x64). The error was reproduced, but under certain conditions. The error reproduces well on a clean operating system with the .NET 6.0.101 SDK installed: If install the .NET 5.0.13 Runtime, then this error no longer occurs: But it happens because .NET perceives the operating system as macOS 11, although the operating system itself has not changed: |
@Taritsyn thank you for your investigation. Do you think that the problem is .NET itself, not DartSassHost? |
Hello, Sergey! Apparently, this error occurs at the Microsoft ClearScript.V8 library level, because when using the JavaScriptEngineSwitcher.ChakraCore and JavaScriptEngineSwitcher.Jint modules everything works correctly. Now I am trying to reproduce this error without using the DartSassHost library. |
It seems that the “Net 6 test runners support” issue and this error have the same reason. If modify your example as follows: dartsasshost-compiler.csproj <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>dartsasshost_compiler</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackAsTool>true</PackAsTool>
<ToolCommandName>dartsasshost-compiler</ToolCommandName>
<AssemblyName>dartsasshost-compiler</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ClearScript.V8" Version="7.2.1" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x86" Version="7.2.1" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.2.1" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-arm64" Version="7.2.1" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.linux-x64" Version="7.2.1" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.linux-arm" Version="7.2.1" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.linux-arm64" Version="7.2.1" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.osx-x64" Version="7.2.1" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.osx-arm64" Version="7.2.1" />
</ItemGroup>
<ItemGroup>
<Content Include="package.csproj" />
</ItemGroup>
</Project> Program.cs using Microsoft.ClearScript.V8;
using (var engine = new V8ScriptEngine())
{
Console.WriteLine("Start script execution...");
engine.Execute(@"var count = 0;
for (var i = 1; i < 1000000; i++) {
count++;
}"
);
var count = (int)engine.Evaluate("count");
Console.WriteLine("Number of iterations: {0}", count);
} Then with a clean installation of the .NET 6.0.101 SDK we will get a similar error: And if the .NET 5.0.13 Runtime is also installed, the result will be correct: |
DartSassHost crashed silently when trying to use it as part of the local
dotnet tool
.Steps to reproduce:
dotnet pack dartsasshost-compiler.csproj
, save the path where is a package created, for example:In this example we need
/Users/sergeyzwezdin/Temp/dotnet-tool-DartSassHost/dartsasshost-compiler/bin/Debug/
dotnet new tool-manifest
dotnet tool install dartsasshost-compiler --version 1.0.0 --add-source=/Users/sergeyzwezdin/Temp/dotnet-tool-DartSassHost/dartsasshost-compiler/bin/Debug/
< replace path heretest.scss
file into the directorydotnet tool run dartsasshost-compiler test.scss
Normally, this should return compiled code like this:
But if we use it as a local dotnet tool it will fail silently and nothing is displayed:
Also, it is interesting that it works okay if we install the tool globally. 🤔
The text was updated successfully, but these errors were encountered: