Javascript problems in ASP.Net MVC applications - Minification failed

Asked

Viewed 71 times

0

I just upgraded my system on the server, and so I went to do the first tests and this agreeing the following errors in my Javascript scripts

/* Minification failed. Returning unminified contents.
(1,1): run-time error CSS1019: Unexpected token, found '$'
(1,2): run-time error CSS1019: Unexpected token, found '('
(1,11): run-time error CSS1031: Expected selector, found ')'
(1,11): run-time error CSS1025: Expected comma or open brace, found ')'
(53,2): run-time error CSS1019: Unexpected token, found ')'
 */

I performed the following settings in the Bundleconfig.Cs file on;

CUSTOM SCRIPTS

public class BundleConfig
{
    // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862
    public static void RegisterBundles(BundleCollection bundles)
    {
        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-{version}.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                    "~/Scripts/jquery.validate*"));

        // Use the development version of Modernizr to develop with and learn from. Then, when you're
        // ready for production, use the build tool at https://modernizr.com to pick only the tests you need.
        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                    "~/Scripts/modernizr-*"));

        bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                  "~/Scripts/bootstrap.js",
                  "~/Scripts/respond.js"));

        bundles.Add(new StyleBundle("~/Content/css").Include(
                  "~/Content/bootstrap.css",
                  "~/Content/site.css"));

        /*############################################
         *############################################
         *S C R I P T S   P E R S O N A L I Z A D O S
         *############################################
        ##############################################*/
        bundles.Add(new StyleBundle("~/Personal/lote-newlot").Include(
                  "~/Scripts/lote.js"));

        bundles.Add(new StyleBundle("~/Personal/lote-index").Include(
                  "~/Scripts/p-lote-index.js"));

        bundles.Add(new StyleBundle("~/Personal/sequencia").Include(
                  "~/Scripts/p-sequencia.js"));
    }
}

1 answer

2


You are minifying Javascript files with Stylebundle. Use Scriptbundle for Javascript files

Browser other questions tagged

You are not signed in. Login or sign up in order to post.