title: ASP.NET MVC 4 Script bundling causes errors upon deployment
body: <p>My website is working fine on localhost when <code>@Scripts.Render()</code> is not bundling the scripts however when I deploy to my server the bundled Javascript must contain an error as all Javascript on my page stops working.</p>
  
  <p>Here is my bundle code:</p>
  
  <pre><code>        public static void RegisterBundles(BundleCollection bundles)
          {
              bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                          "~/Scripts/jquery-{version}.js",
                      "~/Scripts/jquery-migrate-{version}.js"));
  
              bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                      "~/Scripts/jquery.unobtrusive*",
                      "~/Scripts/jquery.validate*"));
  
              bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                          "~/Scripts/jquery-ui-{version}.js",
                          "~/Scripts/jquery-ui.unobtrusive-{version}.js"));
  
              bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                          "~/Scripts/modernizr-*"));
  
              bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
  
              bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                          "~/Content/themes/base/jquery.ui.core.css",
                          "~/Content/themes/base/jquery.ui.resizable.css",
                          "~/Content/themes/base/jquery.ui.selectable.css",
                          "~/Content/themes/base/jquery.ui.accordion.css",
                          "~/Content/themes/base/jquery.ui.autocomplete.css",
                          "~/Content/themes/base/jquery.ui.button.css",
                          "~/Content/themes/base/jquery.ui.dialog.css",
                          "~/Content/themes/base/jquery.ui.slider.css",
                          "~/Content/themes/base/jquery.ui.tabs.css",
                          "~/Content/themes/base/jquery.ui.datepicker.css",
                          "~/Content/themes/base/jquery.ui.progressbar.css",
                          "~/Content/themes/base/jquery.ui.theme.css"));
          }
  </code></pre>
  
  <p>Here is my rendering code:</p>
  
  <pre><code>@Styles.Render("~/Content/css")
  @Styles.Render("~/Content/themes/base/css")
  @Scripts.Render("~/bundles/jquery")
  @Scripts.Render("~/bundles/jqueryval")
  @Scripts.Render("~/bundles/jqueryui")
  @Scripts.Render("~/bundles/modernizr")
  </code></pre>
  
  <p>Can someone explain what might be happening to my Javascript upon deployment?</p>
  
  <p>Thanks,
  Alex.</p>