Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Lagmark 65 posts 140 karma points
    Jul 13, 2015 @ 11:56
    Paul Lagmark
    0

    Cannot render bundles

    Hi guys,

    Im having trouble rendering the bundles that I've created throu Optimus in the backoffice.

    I get the following error in Chrome: http://localhost:7636/bundles/styles Failed to load resource: the server responded with a status of 404 (Not Found)

    And this is from the Umbraco tracelog:

    2015-07-13 13:44:05,855 [14] ERROR System.Web.Optimization.BundleCollection - [Thread 1] Error adding bundles: System.NullReferenceException: Objektreferensen har inte angetts till en instans av ett objekt. vid BundleTransformer.Core.BundleTransformerContext..ctor() vid BundleTransformer.Core.BundleTransformerContext.<.cctor>b_0() vid System.Lazy1.CreateValue() vid System.Lazy1.LazyInitValue() vid System.Lazy1.get_Value() vid BundleTransformer.Core.BundleTransformerContext.get_Current() vid BundleTransformer.Core.Transformers.StyleTransformer..ctor(IMinifier minifier, IList1 translators, IList1 postProcessors, String[] ignorePatterns) vid BundleTransformer.Core.Transformers.StyleTransformer..ctor() vid Optimus.BundleConfig.RegisterBundles(BundleCollection bundles) System.NullReferenceException: Objektreferensen har inte angetts till en instans av ett objekt. vid BundleTransformer.Core.BundleTransformerContext..ctor() vid BundleTransformer.Core.BundleTransformerContext.<.cctor>b__0() vid System.Lazy1.CreateValue() vid System.Lazy1.LazyInitValue() vid System.Lazy1.getValue() vid BundleTransformer.Core.BundleTransformerContext.get_Current() vid BundleTransformer.Core.Transformers.StyleTransformer..ctor(IMinifier minifier, IList1 translators, IList1 postProcessors, String[] ignorePatterns) vid BundleTransformer.Core.Transformers.StyleTransformer..ctor() vid Optimus.BundleConfig.RegisterBundles(BundleCollection bundles)

    I have tried almost everything from the other threads but still cant get it to work.

    Here is stuff from my web.config :

    <location path="umbraco">
    <system.webServer>
      <urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
    <modules>
      <remove name="BundleModule"/>
      <add name="BundleModule" type="System.Web.Optimization.BundleModule"/>
    </modules>
    </system.webServer>
    

    And here is my bundle.config:

    <optimus>  <settings>
    <setting key="onlyAllowCssFilesInEditor" value="True" />
    <setting key="onlyAllowJsFilesInEditor" value="True" />
    <setting key="compileDynamicStyleSheetsToCss" value="True" />
    <setting key="compileDynamicJavaScriptToJs" value="True" />
    <setting key="ignoreCompilationDebug" value="True" /></settings><bundles> <scriptBundle virtualPath="~/bundles/jquery" disableMinification="False">
      <include virtualPath="~/scripts/jquery-2.1.3.js" />
      <include virtualPath="~/scripts/jquery-2.1.3.intellisense.js" />
      <include virtualPath="~/scripts/jquery-ui-1.11.4.js" />
      <include virtualPath="~/scripts/jquery.slicknav.js" />
      <include virtualPath="~/scripts/jquery.unobtrusive-ajax.js" />
    </scriptBundle>
    <scriptBundle virtualPath="~/bundles/myscripts" disableMinification="False">
      <include virtualPath="~/scripts/Features.js" />
      <include virtualPath="~/scripts/MobileMenu.js" />
      <include virtualPath="~/scripts/TopMenu.js" />
    </scriptBundle>
    <scriptBundle virtualPath="~/bundles/images" disableMinification="False">
      <include virtualPath="~/scripts/Lightbox/dist/ekko-lightbox.js" />
      <include virtualPath="~/scripts/Lightbox/Gruntfile.js" />
      <include virtualPath="~/scripts/Galleria/galleria-1.4.2.js" />
      <include virtualPath="~/scripts/Galleria/themes/classic/galleria.classic.js" />
      <include virtualPath="~/scripts/Galleria-start.js" />
    </scriptBundle>
    <styleBundle virtualPath="~/bundles/styles" disableMinification="False">
      <include virtualPath="~/css/MasterStyle.css" />
      <include virtualPath="~/css/TopMenu.css" />
      <include virtualPath="~/css/SideMenu.css" />
      <include virtualPath="~/css/Footer.css" />
      <include virtualPath="~/css/slicknav.css" /></styleBundle></bundles></optimus>
    

    And this is the code for rendering: @Styles.Render("~/bundles/styles")

  • Ben Weeks 14 posts 35 karma points
    Sep 02, 2015 @ 11:51
    Ben Weeks
    0

    Did you find a solution to this?

  • Paul Lagmark 65 posts 140 karma points
    Sep 02, 2015 @ 12:02
    Paul Lagmark
    0

    Yes, I did but I don't recall the solution. I think it had something to do with write-permissions to the server.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies