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

"File to import not found or unreadable" error starts happening after IIS open for a while #16

Closed
jakelauer opened this issue Mar 10, 2018 · 12 comments

Comments

@jakelauer
Copy link

I'm encountering some very strange behavior. This is the error I see:

Server Error in '/' Application.
During translation of SCSS code, readed from the file '/Areas/App/Styles/GameDetail/boxscore.scss', to CSS code syntax error has occurred. 
See more details:

Message: File to import not found or unreadable: ../_Base/_vars.scss.
Parent style sheet: /Areas/App/Styles/GameDetail/boxscore.scss
File: /Areas/App/Styles/GameDetail/boxscore.scss
Line number: 1
Column number: 1
Source fragment:

Line 1: @import "../_Base/_vars.scss";
--------^

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: BundleTransformer.Core.Translators.AssetTranslationException: During translation of SCSS code, readed from the file '/Areas/App/Styles/GameDetail/boxscore.scss', to CSS code syntax error has occurred. 
See more details:

Message: File to import not found or unreadable: ../_Base/_vars.scss.
Parent style sheet: /Areas/App/Styles/GameDetail/boxscore.scss
File: /Areas/App/Styles/GameDetail/boxscore.scss
Line number: 1
Column number: 1
Source fragment:

Line 1: @import "../_Base/_vars.scss";
--------^



Source Error: 


Line 28: 	<meta http-equiv="Content-Language" content="en">
Line 29: 		
Line 30: 	@Styles.Render("~/stylebundles/scss")
Line 31: 	<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
Line 32: 	@RenderSection("ExtraHead", false)

Source File: c:\www\baseballtheaterdev\Shared\Views\_Layout.cshtml    Line: 30 

Stack Trace: 


[AssetTranslationException: During translation of SCSS code, readed from the file '/Areas/App/Styles/GameDetail/boxscore.scss', to CSS code syntax error has occurred. 
See more details:

Message: File to import not found or unreadable: ../_Base/_vars.scss.
Parent style sheet: /Areas/App/Styles/GameDetail/boxscore.scss
File: /Areas/App/Styles/GameDetail/boxscore.scss
Line number: 1
Column number: 1
Source fragment:

Line 1: @import "../_Base/_vars.scss";
--------^

]
   BundleTransformer.SassAndScss.Translators.SassAndScssTranslator.InnerTranslate(IAsset asset, CompilationOptions sassOptions, Boolean enableNativeMinification) +463
   BundleTransformer.SassAndScss.Translators.SassAndScssTranslator.Translate(IList`1 assets) +356
   BundleTransformer.Core.Transformers.TransformerBase.Translate(IList`1 assets, Boolean isDebugMode) +147
   BundleTransformer.Core.Transformers.TransformerBase.Transform(IList`1 assets, BundleContext bundleContext, BundleResponse bundleResponse, VirtualPathProvider virtualPathProvider, Boolean isDebugMode) +126
   BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext bundleContext, BundleResponse bundleResponse, Boolean isDebugMode) +542
   System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable`1 bundleFiles) +305
   BundleTransformer.Core.Resolvers.CustomBundleResolver.GetBundleResponse(Bundle bundle, BundleContext context) +61
   BundleTransformer.Core.Resolvers.CustomBundleResolver.GetBundleContents(String bundleVirtualPath) +204
   System.Web.Optimization.AssetManager.EliminateDuplicatesAndResolveUrls(IEnumerable`1 refs) +453
   System.Web.Optimization.AssetManager.RenderExplicit(String tagFormat, String[] paths) +34
   ASP._Page_Shared_Views__Layout_cshtml.Execute() in c:\www\baseballtheaterdev\Shared\Views\_Layout.cshtml:30
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.WebPages.<>c__DisplayClass40_0.<RenderPageCore>b__0(TextWriter writer) +309
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +108
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +89
   System.Web.WebPages.WebPageBase.PopContext() +310
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +831
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +831
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__5(IAsyncResult asyncResult) +185
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +26
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +67
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +40
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +67
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +395
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +197
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2623.0

This error does not happen at first, when IIS starts. After IIS has been running for a while, though, the error starts happening and doesn't go away.

This happens without the file structure changing - the file that is being read exists and is in the same location that it's in when things are working fine.

I'm not sure where to start in debugging this issue, so I'm trying to figure out what types of things might cause the issue. Would a server low on memory trigger this issue? What other types of situations might cause it?

@Taritsyn
Copy link
Owner

Hello, Jake!

Recently there was a similar problem. But if the ~/Areas/App/Styles/_Base/_vars.scss file does exist on the disk, then problem here is something else.

Does this error only occur on the server or is it also specific to the developer computer?

@Taritsyn
Copy link
Owner

Is this problem still relevant?

@mithsapurva
Copy link

mithsapurva commented Jun 29, 2020

We are facing the same issue after update the BundleTransformer and its dependent nuget packages in the .Net application. Also, we have uninstalled C++ Redistributable as with the latest version it is not required. How is it fixed?

@Taritsyn
Copy link
Owner

@mithsapurva It is possible that your error is similar to the “[BUG] Upgrade to v1.3.1 adds /c/ to paths” error.

In any case, I can’t tell you anything until I see the full error message with stack trace.

@jainAnish
Copy link

Hi @Taritsyn Please find logs for the error we are getting.

Exception:System.Web.HttpException Message:During the output text content of processed asset an unknown error has occurred. See more details: Method not found: 'System.String LibSassHost.Helpers.SassErrorHelpers.GenerateErrorDetails(LibSassHost.SassСompilationException, Boolean)'. WebEventCode : 0 ErrorCode : -2147467259 HResult : -2147467259 Source:BundleTransformer.Core StackTrace: at BundleTransformer.Core.HttpHandlers.AssetHandlerBase.ProcessRequest(HttpContextBase context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

@Taritsyn
Copy link
Owner

See more details: Method not found: 'System.String LibSassHost.Helpers.SassErrorHelpers.GenerateErrorDetails(LibSassHost.SassСompilationException, Boolean)'.

@jainAnish What versions of the BundleTransformer.SassAndScss and LibSassHost packages do you use?

@jainAnish
Copy link

@Taritsyn

BundleTransformer.SassAndScss - 1.12.12 (latest stable version)
LibSassHost - 1.3.1 (latest stable version)

@Taritsyn
Copy link
Owner

@jainAnish Try to clean the bin directory and rebuild your project.

@mithsapurva
Copy link

Hi,

Let me share more details on this:

Version Used
BundleTransformer.SassAndScss - 1.12.12 (latest stable version)
LibSassHost - 1.3.1 (latest stable version)

File Locations
We have a folded named "Content", in that folder we have two files - Common.scss and _myVariables.scss.
The variables file is imported in Common.scss as:
`@import 'myWpVariables';
@import 'myWpMixins';

/*******************************
Base CSS
*******************************/

html {
min-height: 100%;
position: relative;
}
`

When I run this, I am getting the following exception message and stack trace:
Exception:
During translation of SCSS code, readed from the file '/Path to folder/Content/Common.scss', to CSS code syntax error has occurred. See more details: Error: File to import not found or unreadable: _myWpVariables.scss. on line 1:1 of Path to folder/Content/Common.scss >> @import '_myWpVariables.scss'; ^ Error code: 1 Description: File to import not found or unreadable: _myWpVariables.scss. File: /Path to folder/Content/Common.scss Line number: 1 Column number: 1 Source fragment: Line 1: @import '_myWpVariables.scss'; --------^ Line 2: @import '_myWpMixins.scss';

Stack Trace:
Exception:BundleTransformer.Core.Translators.AssetTranslationException Message:During translation of SCSS code, readed from the file '/Path to folder/Content/Common.scss', to CSS code syntax error has occurred. See more details: Error: File to import not found or unreadable: _myWpVariables.scss. on line 1:1 of Path to folder/Content/Common.scss >> @import '_myWpVariables.scss'; ^ Error code: 1 Description: File to import not found or unreadable: _myWpVariables.scss. File: /Path to folder/Content/Common.scss Line number: 1 Column number: 1 Source fragment: Line 1: @import '_myWpVariables.scss'; --------^ Line 2: @import '_myWpMixins.scss'; HResult : -2146233088 Source:BundleTransformer.SassAndScss StackTrace: at BundleTransformer.SassAndScss.Translators.SassAndScssTranslator.InnerTranslate(IAsset asset, CompilationOptions sassOptions, Boolean enableNativeMinification) at BundleTransformer.SassAndScss.Translators.SassAndScssTranslator.Translate(IList1 assets) at BundleTransformer.Core.Transformers.TransformerBase.Translate(IList1 assets, Boolean isDebugMode) at BundleTransformer.Core.Transformers.TransformerBase.Transform(IList1 assets, BundleContext bundleContext, BundleResponse bundleResponse, VirtualPathProvider virtualPathProvider, Boolean isDebugMode) at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext bundleContext, BundleResponse bundleResponse, Boolean isDebugMode) at System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable1 bundleFiles) at System.Web.Optimization.Bundle.GetBundleResponse(BundleContext context) at System.Web.Optimization.Bundle.ProcessRequest(BundleContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I tried clearing the bin and rebuilding the project but again the same error.
Please suggest how to fix this issue.

@Taritsyn
Copy link
Owner

@mithsapurva Unfortunately, I couldn't reproduce your error.

Try reproducing this error as a demo project and send me a link to it.

@rdenysiuk
Copy link

rdenysiuk commented Mar 30, 2021

I had a such problem also.
In my project installed

LibSassHost 1.3.1
LibSassHost.Native.win-x64 1.3.1
BundleTransformer.SassAndScss 1.12.22

I tryied to add another one package LibSassHost.Native.win-x86, but after this I had another error

I noticed when I run the project iisexpress.exe runs from folder C:\Program Files (x86)\IIS Express.
Then I have changed one options in my VS2019
Tools -> Options -> Project and Solutions -> Web Projects and check the option
And check
Use the 64 bit version of IIS Express for web sites and projects

Screenshot_119

After this simple change my project runs even without Re-Build

Hope, my message will help someone, because I spent a lot of time to solve the issue

@Taritsyn
Copy link
Owner

Hello, Roman!

The “File to import not found or unreadable” error has nothing to do with loading the native assemblies, it is related to reading of Sass- or SCSS-files.

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

5 participants