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

Errors with Chart.js #590

Open
SoftCircuits opened this issue Jul 10, 2022 · 0 comments
Open

Errors with Chart.js #590

SoftCircuits opened this issue Jul 10, 2022 · 0 comments

Comments

@SoftCircuits
Copy link

SoftCircuits commented Jul 10, 2022

Installed product versions

  • Visual Studio: 2022 Community
  • This extension: 2.9.3

Description

I'm getting the following errors minifying and bundling Chart.js.

Severity	Code	Description	Project	File	Line	Suppression State
Error		(Bundler & Minifier) Strict-mode does not allow duplicate property names: =		D:\Users\jwood\source\repos\Railtrax\Pegasus\wwwroot\bundles\charts.min.js	1841	
Error		(Bundler & Minifier) Strict-mode does not allow duplicate property names: =		D:\Users\jwood\source\repos\Railtrax\Pegasus\wwwroot\bundles\charts.min.js	1841	
Error		(Bundler & Minifier) Implicit property name must be identifier: stackWeight =		D:\Users\jwood\source\repos\Railtrax\Pegasus\wwwroot\bundles\charts.min.js	3016	
Error		(Bundler & Minifier) Strict-mode does not allow duplicate property names: =		D:\Users\jwood\source\repos\Railtrax\Pegasus\wwwroot\bundles\charts.min.js	4253	
Error		(Bundler & Minifier) Strict-mode does not allow duplicate property names: =		D:\Users\jwood\source\repos\Railtrax\Pegasus\wwwroot\bundles\charts.min.js	7703	
Error		(Bundler & Minifier) Strict-mode does not allow duplicate property names: =		D:\Users\jwood\source\repos\Railtrax\Pegasus\wwwroot\bundles\charts.min.js	9866	
Error		(Bundler & Minifier) Strict-mode does not allow duplicate property names: =		D:\Users\jwood\source\repos\Railtrax\Pegasus\wwwroot\bundles\charts.min.js	10164	
Error		(Bundler & Minifier) Strict-mode does not allow duplicate property names: =		D:\Users\jwood\source\repos\Railtrax\Pegasus\wwwroot\bundles\charts.min.js	10330	

Issue 1

What exactly is the error? charts.min.js is the output filename so I'm not sure why the output file is the error. Could it be that it's already minified and there's an error during bundling? Why is it checking CSS syntax during bundling? Wouldn't that be checked during CSS minification?

NOTE: Because of these errors, no charts.min.js file is created. So it appears that I am unable to view the line that causes the error.

Issue 2

Does chart.js have invalid CSS? It's a very advanced and modern library. Seems to work fine until I pass it to Bundler & Minifier.

Here's my bundleconfig.json file.

[
  // Site.css
  {
    "outputFileName": "wwwroot/bundles/site.min.css",
    "inputFiles": [
      "wwwroot/css/site.css"
    ]
  },
  {
    "outputFileName": "wwwroot/bundles/site.min.js",
    "inputFiles": [
      "wwwroot/js/site.js"
    ]
  },

  // Layout
  {
    "outputFileName": "wwwroot/bundles/layout.min.css",
    "inputFiles": [
      "wwwroot/css/layout/app.css",
      "wwwroot/css/layout/style.css"
    ]
  }, 
  {
    "outputFileName": "wwwroot/bundles/layout.min.js",
    "inputFiles": [
      "wwwroot/js/layout/metismenu.js",
      "wwwroot//jslayout/app.js"
    ]
  },

  // Bootstrap-select
  {
    "outputFileName": "wwwroot/bundles/bootstrap-select.min.css",
    "inputFiles": [
      "wwwroot/css/bootstrap-select.css"
    ]
  },
  {
    "outputFileName": "wwwroot/bundles/bootstrap-select.min.js",
    "inputFiles": [
      "wwwroot/js/bootstrap-select.js"
    ]
  },

  // Charts
  {
    // Bundle js/charts.min.js + chartjs/chart.min.js
    "outputFileName": "wwwroot/bundles/charts.min.js",
    "inputFiles": [
      "wwwroot/lib/chartjs/chart.js",
      "wwwroot/js/charts.js"
    ]
  }
]
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

1 participant