Skip to content
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

Exceptions from DartSassHost #55

Open
timheuer opened this issue Jul 20, 2022 · 19 comments
Open

Exceptions from DartSassHost #55

timheuer opened this issue Jul 20, 2022 · 19 comments

Comments

@timheuer
Copy link

I just updated my app to the latest package here and now get runtime errors

SassCompilationException: Error: Value cannot be null. (Parameter 'name')
DartSassHost.JsonConverters.CompilationResultConverter.ReadResult(ref Utf8JsonReader reader)
DartSassHost.JsonConverters.CompilationResultConverter.Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System.Text.Json.Serialization.JsonConverter<T>.TryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out T value)
System.Text.Json.Serialization.JsonConverter<T>.ReadCore(ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state)
System.Text.Json.JsonSerializer.ReadFromSpan<TValue>(ReadOnlySpan<byte> utf8Json, JsonTypeInfo jsonTypeInfo, Nullable<int> actualByteCount)
System.Text.Json.JsonSerializer.ReadFromSpan<TValue>(ReadOnlySpan<char> json, JsonTypeInfo jsonTypeInfo)
System.Text.Json.JsonSerializer.Deserialize<TValue>(string json, JsonSerializerOptions options)
DartSassHost.UnifiedJsonSerializer.DeserializeObject<T>(string json)
DartSassHost.SassCompiler.CompileFile(string inputPath, string outputPath, string sourceMapPath, CompilationOptions options)
WebOptimizer.Sass.Compiler.ExecuteAsync(IAssetContext context)
WebOptimizer.Asset.ExecuteAsync(HttpContext context, IWebOptimizerOptions options)
WebOptimizer.AssetBuilder.BuildAsync(IAsset asset, HttpContext context, IWebOptimizerOptions options)
WebOptimizer.Taghelpers.LinkInlineHrefTagHelper.GetFileContentAsync(string route)
WebOptimizer.Taghelpers.LinkInlineHrefTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
...

Looking at the DartSassHost project it is not listed as stable by the author

@timheuer
Copy link
Author

@Taritsyn

@Taritsyn
Copy link
Contributor

@timheuer What versions of packages are you currently using?

@timheuer
Copy link
Author

<PackageReference Include="LigerShark.WebOptimizer.Core" Version="3.0.368" />
<PackageReference Include="LigerShark.WebOptimizer.Sass" Version="3.0.91" />

When it throws exception, it is on a Razor page where I have:

<meta name="description" content="@ViewData["Description"]" />

in the <head> of my layout component.

@Taritsyn
Copy link
Contributor

It is also important to know the versions of the following packages: DartSassHost, JavaScriptEngineSwitcher.V8 and Microsoft.ClearScript.V8.Native.*.

@Taritsyn
Copy link
Contributor

I would also want to know the version of ASP.NET Core and under which operating system the web application run.

@Taritsyn
Copy link
Contributor

It will be very difficult to determine the causes of this error, because from description (Value cannot be null. (Parameter 'name')) it can be seen that it occurred in JS code when calling .NET method.

So far I have not been able to reproduce this error.

@Taritsyn
Copy link
Contributor

@timheuer Did version 3.0.84 of the LigerShark.WebOptimizer.Sass work without errors?

@timheuer
Copy link
Author

timheuer commented Aug 1, 2022

No the same error applies when I use 3.0.84

@ThomasBjallas
Copy link

Any solution for this?

I am getting the same error when upgrading from .NET 6 to .NET 7 RC1

@Temoxa
Copy link

Temoxa commented Dec 1, 2022

Hello!

I also get some error after move project from NET 5.0 to NET 7.0

Current use LigerShark.WebOptimizer.Sass - 3.0.84 ( 3.0.91 too with error)

image

@Taritsyn
Copy link
Contributor

Taritsyn commented Dec 1, 2022

@Temoxa

This is a syntax error in line 21 column 65 of the /scss/landing/main.scss file.

@Temoxa
Copy link

Temoxa commented Dec 2, 2022

@Temoxa

This is a syntax error in line 21 column 65 of the /scss/landing/main.scss file.

Why its worked in NET 5.0 ? Scss file was not modifyed

Also in stacktace error Exceptions from DartSassHost was too

@Taritsyn
Copy link
Contributor

Taritsyn commented Dec 2, 2022

Scss file was not modifyed

Are you sure about this?

@Temoxa
Copy link

Temoxa commented Dec 5, 2022

Scss file was not modifyed

Are you sure about this?

yes, of cource

@Taritsyn
Copy link
Contributor

Taritsyn commented Dec 6, 2022

Hello, @Temoxa!

Try to reproduce this error in the form of demo project and post a link to it in this discussion.

@Temoxa
Copy link

Temoxa commented Dec 6, 2022

SassCompilationException: Error: (0: 0, 1: 0.25rem, 2: 0.5rem, 3: 1rem, 4: 1.5rem, 5: 3rem) isn't a valid CSS value.
at wwwroot/scss/landing/main.scss:30:65 -> $negative-spacers: if( $enable-negative-margins, negativify-map($spacers), null );

as on my screenshot upper

in previos veriosn compiled is OK, maybe error in Bootstrap ?

image

@Taritsyn
Copy link
Contributor

Taritsyn commented Dec 6, 2022

@Temoxa, I initially said that the problem is in SCSS code. It is possible that the new version of the Bootstrap uses a newer version of the Sass language.

For now, try upgrading the DartSassHost package to version 1.0.0 Preview 8. Within a few days I will release a DartSassHost with support for the the Dart Sass version 1.56.1.

@Taritsyn
Copy link
Contributor

Taritsyn commented Dec 9, 2022

Hello, @Temoxa!

Dart Sass Host version 1.0.0 Preview 9 released.

@Temoxa
Copy link

Temoxa commented Dec 21, 2022

Hello, @Temoxa!

Dart Sass Host version 1.0.0 Preview 9 released.

hello! :)

I removed unused function in scss and project successful run

But i will try new version, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants