Giter VIP home page Giter VIP logo

Comments (31)

pefgoncalves avatar pefgoncalves commented on July 1, 2024

The only thing is still not working is the importing path. Looks like it's getting on app root folder.

During translation of SCSS code, readed from the file '~/Styles/_bootstrap.scss', to CSS code syntax error has occurred. 
See more details:

Message: File to import not found or unreadable: bootstrap/variables.
Parent style sheet: ~/Styles/_bootstrap.scss
File: ~/Styles/_bootstrap.scss
Line number: 8
Column number: 1
Source fragment:

Line 7: // Core variables and mixins
Line 8: @import "bootstrap/variables";
--------^
Line 9: @import "bootstrap/mixins";

If i change my import to use full path, it works:
``` @import "/styles/bootstrap/variables";````

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

Hello!

So, I am porting and existing .net app to mono but i couldn't install 'LibSassHost.Native.osx-x64.1.0.4' there.

In package description and documentation clearly says the following: “This package is only compatible with .NET Core.”. In Mono you need to independently deploy the libsass.dylib assembly file.

I generated the build file described here: https://github.com/Taritsyn/LibSassHost#os-x, but the output generated was *.dylib, and i couldn't make it work on my project.

This is correct behavior.

During translation of SCSS code, readed from the file '~/Styles/_bootstrap.scss', to CSS code syntax error has occurred.

Are you porting an ASP.NET application?

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

You are trying to use the Bundle Transformer in Mono for OS X? Are you using the original assemblies or modified source code?

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

Yes, porting an .net app and i'm also using Bundle Transformer with original assemblies:

var styleBundle = new CustomStyleBundle("~/lib/css").Include(
               "~/Styles/jquery-ui/jquery-ui.structure.css",
               "~/Styles/jquery-ui/jquery-ui.theme.css",
               "~/Styles/_bootstrap.scss",
               "~/Styles/jquery.webui-popover.css",
               "~/Styles/jscrollpane.css",
               "~/Styles/font-awesome/css/font-awesome.css",
               "~/Styles/bootstrap-datepicker.min.css",
               "~/Styles/animate.css",
               "~/Styles/text-angular/textAngular.css",
               "~/Styles/daterangepicker-angular/daterangepicker.css",
               "~/Styles/app.scss"
            );

            styleBundle.Builder = new NullBuilder();
            styleBundle.Transforms.Add(new StyleTransformer());
            styleBundle.Orderer = new NullOrderer();
            bundles.Add(styleBundle);

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024
During translation of SCSS code, readed from the file '~/Styles/_bootstrap.scss', to CSS code syntax error has occurred.
…

This error message shows, that path of _bootstrap.scss file was not converted to absolute. It still starts with a ~/, but must starts with a /.

I recommend you to debug a ToAbsolutePath method of VirtualFileManager class. Most likely, this problem is caused by specificity of the Virtual Path Provider implementation for Mono. How to set your own VPP read the “New Web Optimization Pre-Release Package on NuGet” article.

P.S.: I do not guarantee compatibility of the Bundle Transformer with operating systems other than Windows.

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

Try to update the Bundle Transformer to version 1.9.171 Beta 1. Waiting for feedback.

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

Still not working:

These assets are not style sheets: ~/Styles/_bootstrap.scss, ~/Styles/twyne.scss.

Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): BundleTransformer.Core.
Exception stack trace:

at BundleTransformer.Core.Validators.StyleAssetTypesValidator.Validate (System.Collections.Generic.IList`1[T] assets) [0x00092] in <2225cff0685c4a3da247b1bb67f35bcf>:0 
  at BundleTransformer.Core.Transformers.StyleTransformer.ValidateAssetTypes (System.Collections.Generic.IList`1[T] assets) [0x00006] in <2225cff0685c4a3da247b1bb67f35bcf>:0 
  at BundleTransformer.Core.Transformers.TransformerBase.Transform (System.Collections.Generic.IList`1[T] assets, System.Web.Optimization.BundleContext bundleContext, System.Web.Optimization.BundleResponse bundleResponse, System.Web.Hosting.VirtualPathProvider virtualPathProvider, System.Boolean isDebugMode) [0x00000] in <2225cff0685c4a3da247b1bb67f35bcf>:0 
  at BundleTransformer.Core.Transformers.TransformerBase.Process (System.Web.Optimization.BundleContext bundleContext, System.Web.Optimization.BundleResponse bundleResponse, System.Boolean isDebugMode) [0x00088] in <2225cff0685c4a3da247b1bb67f35bcf>:0 
  at BundleTransformer.Core.Transformers.TransformerBase.Process (System.Web.Optimization.BundleContext bundleContext, System.Web.Optimization.BundleResponse bundleResponse) [0x0000d] in <2225cff0685c4a3da247b1bb67f35bcf>:0 
  at System.Web.Optimization.Bundle.ApplyTransforms (System.Web.Optimization.BundleContext context, System.String bundleContent, System.Collections.Generic.IEnumerable`1[T] bundleFiles) [0x00041] in <1722374db59b42df883d8c695dc145b3>:0 
  at System.Web.Optimization.Bundle.GenerateBundleResponse (System.Web.Optimization.BundleContext context) [0x00061] in <1722374db59b42df883d8c695dc145b3>:0 
  at BundleTransformer.Core.Resolvers.CustomBundleResolver.GetBundleResponse (System.Web.Optimization.Bundle bundle, System.Web.Optimization.BundleContext context) [0x00013] in <2225cff0685c4a3da247b1bb67f35bcf>:0 
  at BundleTransformer.Core.Resolvers.CustomBundleResolver.GetBundleContents (System.String bundleVirtualPath) [0x0003a] in <2225cff0685c4a3da247b1bb67f35bcf>:0 
  at System.Web.Optimization.AssetManager.DeterminePathsToRender (System.Collections.Generic.IEnumerable`1[T] assets) [0x0003a] in <1722374db59b42df883d8c695dc145b3>:0 
  at System.Web.Optimization.AssetManager.RenderExplicit (System.String tagFormat, System.String[] paths) [0x00000] in <1722374db59b42df883d8c695dc145b3>:0 
  at System.Web.Optimization.Styles.RenderFormat (System.String tagFormat, System.String[] paths) [0x0004d] in <1722374db59b42df883d8c695dc145b3>:0 
  at System.Web.Optimization.Styles.Render (System.String[] paths) [0x00005] in <1722374db59b42df883d8c695dc145b3>:0 
  at ASP._Page_Views_Shared__LoginLayout_cshtml.Execute () [0x0005d] in /Users/pgoncalves/dev/clients/twyne/twyne.admin.v2/Views/Shared/_LoginLayout.cshtml:7 
  at System.Web.WebPages.WebPageBase.ExecutePageHierarchy () [0x00054] in <455c0c5cbc804c5abc3af7275091c0c5>:0 
  at System.Web.Mvc.WebViewPage.ExecutePageHierarchy () [0x0001d] in <cc73190bab9d435c831510ff295c572a>:0 
  at System.Web.WebPages.WebPageBase.ExecutePageHierarchy (System.Web.WebPages.WebPageContext pageContext, System.IO.TextWriter writer, System.Web.WebPages.WebPageRenderingBase startPage) [0x0002f] in <455c0c5cbc804c5abc3af7275091c0c5>:0 
  at System.Web.WebPages.WebPageBase.ExecutePageHierarchy (System.Web.WebPages.WebPageContext pageContext, System.IO.TextWriter writer) [0x00000] in <455c0c5cbc804c5abc3af7275091c0c5>:0 
  at System.Web.WebPages.WebPageBase+<>c__DisplayClass3.<RenderPageCore>b__2 (System.IO.TextWriter writer) [0x00085] in <455c0c5cbc804c5abc3af7275091c0c5>:0 
  at System.Web.WebPages.HelperResult.WriteTo (System.IO.TextWriter writer) [0x00000] in <455c0c5cbc804c5abc3af7275091c0c5>:0 
  at System.Web.WebPages.WebPageExecutingBase.WriteTo (System.IO.TextWriter writer, System.Web.WebPages.HelperResult content) [0x00003] in <455c0c5cbc804c5abc3af7275091c0c5>:0 
  at System.Web.WebPages.WebPageBase.Write (System.Web.WebPages.HelperResult result) [0x00006] in <455c0c5cbc804c5abc3af7275091c0c5>:0 
  at System.Web.WebPages.WebPageBase.RenderSurrounding (System.String partialViewName, System.Action`1[T] body) [0x00027] in <455c0c5cbc804c5abc3af7275091c0c5>:0 
  at System.Web.WebPages.WebPageBase.PopContext () [0x00037] in <455c0c5cbc804c5abc3af7275091c0c5>:0 
  at System.Web.WebPages.WebPageBase.ExecutePageHierarchy (System.Web.WebPages.WebPageContext pageContext, System.IO.TextWriter writer, System.Web.WebPages.WebPageRenderingBase startPage) [0x00035] in <455c0c5cbc804c5abc3af7275091c0c5>:0 
  at System.Web.Mvc.RazorView.RenderView (System.Web.Mvc.ViewContext viewContext, System.IO.TextWriter writer, System.Object instance) [0x000c7] in <cc73190bab9d435c831510ff295c572a>:0 
  at System.Web.Mvc.BuildManagerCompiledView.Render (System.Web.Mvc.ViewContext viewContext, System.IO.TextWriter writer) [0x00067] in <cc73190bab9d435c831510ff295c572a>:0 
  at System.Web.Mvc.ViewResultBase.ExecuteResult (System.Web.Mvc.ControllerContext context) [0x00080] in <cc73190bab9d435c831510ff295c572a>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Collections.Generic.IList`1[T] filters, System.Int32 filterIndex, System.Web.Mvc.ResultExecutingContext preContext, System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x0000b] in <cc73190bab9d435c831510ff295c572a>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Collections.Generic.IList`1[T] filters, System.Int32 filterIndex, System.Web.Mvc.ResultExecutingContext preContext, System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x0009b] in <cc73190bab9d435c831510ff295c572a>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Collections.Generic.IList`1[T] filters, System.Int32 filterIndex, System.Web.Mvc.ResultExecutingContext preContext, System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x0009b] in <cc73190bab9d435c831510ff295c572a>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Collections.Generic.IList`1[T] filters, System.Int32 filterIndex, System.Web.Mvc.ResultExecutingContext preContext, System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x0009b] in <cc73190bab9d435c831510ff295c572a>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters (System.Web.Mvc.ControllerContext controllerContext, System.Collections.Generic.IList`1[T] filters, System.Web.Mvc.ActionResult actionResult) [0x0000a] in <cc73190bab9d435c831510ff295c572a>:0 
  at System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass21+<>c__DisplayClass2b.<BeginInvokeAction>b__1c () [0x0008a] in <cc73190bab9d435c831510ff295c572a>:0 

That is the content o _bootstrap.scss


// Core variables and mixins
@import "bootstrap/variables";
@import "bootstrap/mixins";

// Reset and dependencies
@import "bootstrap/normalize";

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

These assets are not style sheets: ~/Styles/_bootstrap.scss, ~/Styles/twyne.scss.

It looks like you do not have the following settings in the Web.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	…
	<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
		<core>
			…
			<css …>
				…
				<fileExtensions>
					…
					<add fileExtension=".sass" assetTypeCode="Sass" />
					<add fileExtension=".scss" assetTypeCode="Scss" />
					…
				</fileExtensions>
				…
			</css>
			…
		</core>
		…
	</bundleTransformer>
	…
</configuration>

I already see such a error today.

Yes, porting an .net app...

If your .NET application is not a ASP.NET web application, then what kind of .NET application is it?

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

With your suggestion, worked, but looks like the imported files are not loading up:

image

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

You have installed the BundleTransformer.SassAndScss package?

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

Remove the following line:

styleBundle.Transforms.Add(new StyleTransformer());

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

You registered a bundle with a ~/Styles/bootstrap/mixins name?

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

I removed that line, but same effect.

I haven't, but why am I need to have it? on _bootstrap, I have this:
@import "bootstrap/mixins";
and mixin has other includes:

@import "mixins/hide-text";
@import "mixins/opacity";
@import "mixins/image";
@import "mixins/labels";
@import "mixins/reset-filter";
@import "mixins/resize";
@import "mixins/responsive-visibility";
@import "mixins/size";
@import "mixins/tab-focus";
@import "mixins/reset-text";
@import "mixins/text-emphasis";
@import "mixins/text-overflow";
@import "mixins/vendor-prefixes";
```

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

Why did you request through the browser this URL - /Styles/bootstrap/mixins/?

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

I didn't do that. Looks like the css is parsing as another file. This is happening when there is nested imports.

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

Check this out, every import is doing extra requests:

image

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

You have this web application worked on Windows?

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

Yes, the same source code is working fine

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

Check which result produces the following expression:

System.Web.VirtualPathUtility.ToAbsolute("~/Styles/_bootstrap.scss")

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

Yes, the same source code is working fine

Where did “These assets are not style sheets: ~/Styles/_bootstrap.scss, ~/Styles/twyne.scss.” error come from?

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

/Styles/_bootstrap.scss

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

I had when i access any route that is including render

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

Now check this expression:

new BundleTransformer.Core.FileSystem.VirtualFileSystemWrapper().ToAbsolutePath("~/Styles/_bootstrap.scss")

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

I can't find this namespace: BundleTransformer.Core

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

I can't find this namespace: BundleTransformer.Core

It doesn't matter. I have tested the Bundle Transformer on Mono for Mac OS X.

To fix a error add the following settings to the Web.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	…
	<system.web>
		…
		<httpHandlers>
			…
			<add path="*.sass" verb="GET"
				type="BundleTransformer.SassAndScss.HttpHandlers.SassAndScssAssetHandler, BundleTransformer.SassAndScss" />
			<add path="*.scss" verb="GET"
				type="BundleTransformer.SassAndScss.HttpHandlers.SassAndScssAssetHandler, BundleTransformer.SassAndScss" />
			…
		</httpHandlers>
		…
	</system.web>
	…
</configuration>

This error is described in detail in the “Mono and IHttpHandler” discussion on Stack Overflow. Solution to this problem is also described in the “Sass and SCSS” section of documentation.

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

Awesome! It's working perfectly! Thank you much for your help =)

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

Hey, i updated the libs and i'm having this:

sass_file_manager_set_get_current_directory_delegate

Description: HTTP 500.Error processing request.
Details: Non-web exception.
Exception stack trace:
  at (wrapper managed-to-native) LibSassHost.Internal.Native.Sass_Api:sass_file_manager_set_get_current_directory_delegate_utf8 (LibSassHost.Internal.Native.Func_StringAnsi)
  at LibSassHost.Internal.FileManagerMarshaler.SetFileManager (LibSassHost.IFileManager fileManager) [0x000fb] in <001e106848664c699a34bda535594f0f>:0 
  at LibSassHost.SassCompiler.set_FileManager (LibSassHost.IFileManager value) [0x00016] in <001e106848664c699a34bda535594f0f>:0 
  at BundleTransformer.SassAndScss.Translators.SassAndScssTranslator.Initialize () [0x00035] in <b7a265be386e4ea58be4ccc428d06b2b>:0 
  at BundleTransformer.SassAndScss.Translators.SassAndScssTranslator.Translate (System.Collections.Generic.IList`1[T] assets) [0x00050] in <b7a265be386e4ea58be4ccc428d06b2b>:0 
  at BundleTransformer.Core.Transformers.TransformerBase.Translate (System.Collections.Generic.IList`1[T] assets, System.Boolean isDebugMode) [0x0001e] in <1ce8222a4b614473b2f3be937f52afca>:0 
  at BundleTransformer.Core.Transformers.TransformerBase.Transform (System.Collections.Generic.IList`1[T] assets, System.Web.Optimization.BundleContext bundleContext, System.Web.Optimization.BundleResponse bundleResponse, System.Web.Hosting.VirtualPathProvider virtualPathProvider, System.Boolean isDebugMode) [0x00024] in <1ce8222a4b614473b2f3be937f52afca>:0 
  at BundleTransformer.Core.Transformers.TransformerBase.Process (System.Web.Optimization.BundleContext bundleContext, System.Web.Optimization.BundleResponse bundleResponse, System.Boolean isDebugMode) [0x00088] in <1ce8222a4b614473b2f3be937f52afca>:0 
  at BundleTransformer.Core.Transformers.TransformerBase.Process (System.Web.Optimization.BundleContext bundleContext, System.Web.Optimization.BundleResponse bundleResponse) [0x0000d] in <1ce8222a4b614473b2f3be937f52afca>:0 
  at System.Web.Optimization.Bundle.ApplyTransforms (System.Web.Optimization.BundleContext context, System.String bundleContent, System.Collections.Generic.IEnumerable`1[T] bundleFiles) [0x00041] in <1722374db59b42df883d8c695dc145b3>:0 
  at System.Web.Optimization.Bundle.GenerateBundleResponse (System.Web.Optimization.BundleContext context) [0x00061] in <1722374db59b42df883d8c695dc145b3>:0 
  at BundleTransformer.Core.Resolvers.CustomBundleResolver.GetBundleResponse (System.Web.Optimization.Bundle bundle, System.Web.Optimization.BundleContext context) [0x00013] in <1ce8222a4b614473b2f3be937f52afca>:0 
  at BundleTransformer.Core.Resolvers.CustomBundleResolver.GetBundleContents (System.String bundleVirtualPath) [0x0003a] in <1ce8222a4b614473b2f3be937f52afca>:0 
  at System.Web.Optimization.AssetManager.DeterminePathsToRender (System.Collections.Generic.IEnumerable`1[T] assets) [0x0003a] in <1722374db59b42df883d8c695dc145b3>:0 
  at System.Web.Optimization.AssetManager.RenderExplicit (System.String tagFormat, System.String[] paths) [0x00000] in <1722374db59b42df883d8c695dc145b3>:0 
  at System.Web.Optimization.Styles.RenderFormat (System.String tagFormat, System.String[] paths) [0x0004d] in <1722374db59b42df883d8c695dc145b3>:0 
  at System.Web.Optimization.Styles.Render (System.String[] paths) [0x00005] in <1722374db59b42df883d8c695dc145b3>:0 ```

do you know what it could be?

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

Most likely, you are using the version of libsass.dylib assembly, which is not adapted for the LibSass Host. About this is written in the documentation.

I recommend you to download a modified version of the LibSass library.

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

I just copied your file to /Library/Frameworks/ and having the same issue.

from libsasshost.

pefgoncalves avatar pefgoncalves commented on July 1, 2024

I had to copy the file to projectroot, and with that worked, Is that the correct behavior?

from libsasshost.

Taritsyn avatar Taritsyn commented on July 1, 2024

If you installed the LibSass library by using the following command:

brew install libsass

or

brew reinstall libsass

As a result, libsass.0.dylib, libsass.a and libsass.dylib files were linked to the /usr/local/lib/ directory. To remove these files, run the following command:

brew remove --force libsass

Then you can install a modified version of the LibSass library as follows:

mkdir -p /usr/local/lib/ && cp libsass.dylib "$_"

from libsasshost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.