2

Here are my bundels:

public static void RegisterBundles(BundleCollection bundles)
{
    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                "~/Bootstrap/assets/js/jquery.js"));

    bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                "~/Bootstrap/assets/js/bootstrap-transition.js",
                "~/Bootstrap/assets/js/bootstrap-alert.js",
                "~/Bootstrap/assets/js/bootstrap-modal.js",
                "~/Bootstrap/assets/js/bootstrap-dropdown.js",
                "~/Bootstrap/assets/js/bootstrap-scrollspy.js",
                "~/Bootstrap/assets/js/bootstrap-tab.js",
                "~/Bootstrap/assets/js/bootstrap-tooltip.js",
                "~/Bootstrap/assets/js/bootstrap-popover.js",
                "~/Bootstrap/assets/js/bootstrap-button.js",
                "~/Bootstrap/assets/js/bootstrap-collapse.js",
                "~/Bootstrap/assets/js/bootstrap-carousel.js",
                "~/Bootstrap/assets/js/bootstrap-typeahead.js",
                "~/Bootstrap/assets/js/bootstrap-affix.js",
                "~/Bootstrap/assets/js/application.js",
                "~/Bootstrap/assets/js/bootstrap.js"
                ));

}

And here is part of the content from my _Layout page:

@Scripts.Render("~/bundles/bootstrap")
... 

When I try running this application I get js error that looks something like this

An Error has occurred in the script on this page
Object Expected
URL   http://servername/AppName/bundles/bootstrap?v=asdjisdjsincdjijadosJISJDIS_idosd 

A similar question was asked here: Why is my CSS bundling not working with a bin deployed MVC4 app?

I tried adding this configuration to my web.config file as suggested in question that I referenced

<modules runAllManagedModulesForAllRequests="true">
  <remove name="BundleModule" />
  <add name="BundleModule" type="System.Web.Optimization.BundleModule" />
</modules>

and I am still getting the same error.

If something is not clear please let me know and I will elaborate. Thanks

Community
  • 1
  • 1
gumenimeda
  • 815
  • 7
  • 15
  • 43
  • are you rendering your jquery bundle before your bootstrap bundle? it's not shown in your code – Claies Aug 06 '13 at 02:52
  • are all of the scripts in your bundles third party ones? – Paul Taylor Sep 04 '13 at 15:55
  • No. Some of them are mine. I "solved" this problem by turning off bundling(not really solving it). I am planning on enabling it at the end of the project and coming back to this issue. – gumenimeda Sep 04 '13 at 17:24

1 Answers1

0

Does Bundle folder exisit in your application?

Try:

bundles.Add(new ScriptBundle("~/Bootstrap/assets/js/jquery").Include(
            "~/Bootstrap/assets/js/jquery.js"));

bundles.Add(new ScriptBundle("~/Bootstrap/assets/js/bootstrap").Include(

http://www.mvccentral.net/Story/Details/articles/kahanu/stylebundle-403-error-solved

MVC CSS not rendering in Visual Studio When debugging

Community
  • 1
  • 1
Findulias
  • 1
  • 1