Chart.js: Bower Support Dropped, no dist folder

Created on 3 Aug 2016  路  18Comments  路  Source: chartjs/Chart.js

I'm not sure why bower was dropped but the bower install is not sufficient as it does not include a dist folder minified chart.js files or the bundles. Furthermore, I get all a conflict when I also have angular-chart.js in my bower file. The two different chart entries in my bower file clobber eachother and end up removing the dist folder.

infrastructure

Most helpful comment

Fixed in version 2.3.0, no need to use bower-npm-resolver anymore, native Bower support is back. Also, the chart.js bower package now points on the correct repository.

All 18 comments

Are you using the npm resolver as mentioned in the docs?

In repository disappeared folder dist

Yes I am using the npm resolver as described in the docs.

@stephenHartzell reasons explained in this comment. Can you post your bower.json configuration file, and also the content of the chart.js package. I just checked, and dist files should be there.

@simonbrunel here's my bower.json:

"dependencies": {
    "angular": "^1.5.8",
    "angular-route": "^1.5.8",
    "angular-animate": "^1.5.8",
    "jquery": "^3.1.0",
    "bootstrap": "^3.3.7",
    "angular-bootstrap": "^1.3.3",
    "angular-chart.js": "^1.0.0",
    "angular-scroll": "^1.0.0",
    "chart.js": "npm:chart.js#^2.2.1"
  },
  "resolutions": {
    "jquery": "^3.1.0"
  }

Here's my .bowerrc file:

{
  "resolvers": [
    "bower-npm-resolver"
  ]
}

Starting from scratch (i.e. no bower_components directory) and running bower install produces a syntax error when it gets to chart.js because it's .bower.json looks like this:

{
  "name": "Chart.js",
  "homepage": "https://github.com/nnnick/Chart.js",
  "version": "2.2.1",
  "_release": "2.2.1",
  "_resolution": {
    "type": "version",
    "tag": "v2.2.1",
    "commit": "ab66146013a6b7c687630b414ba8731a6f25337c"
  },
  "_source": "https://github.com/nnnick/Chart.js.git",
  "_target": "2.x"
}_source": "npm:chart.js",
  "_target": "2.2.1",
  "_release": "2.2.1",
  "version": "2.2.1"
}

Note the bad syntax at _source.

The work around, is to delete the chart.js folder and then run bower install npm:chart.js. Then I have all my dependencies. With regard to the dist folder, now it appears each time I run bower install. I swear it wasn't yesterday after starting from scratch several times. In anycase, some of the files are corrupted (such as the .bower.json file) clobbering.

So do you mean it works if no previous version was installed? Looks like bower-npm-resolver messes up if there is already a version installed from a GH repository. If so, we should add that in the documentation.

That's not quite what I mean. It'd probably be easiest for you to see it or yourself. If you grab that bower.json and run bower install you'll get an error.

That's also kind of a breaking change, which breaks build since it does not respect the semver standard.

@stephenHartzell: I think there is a conflict with the angular-chart.js lib which install the dependency via the GH repo, not npm. It works for me if I remove the angular-chart.js dependency _or_ if I first bower install without the npm:chart.js, then bower install npm:chart.js --save. Anyway, there is a bug here, not sure how to fix it. Maybe @jtblin will have some inputs about it?

I have been usign Chart.js and angular-chart.js in a Rails project for some time. Went to deploy some updates to staging server and rake bower install is failing on this issue. No longer a Chart.js file at the project root or a dist dir.

@simonbrunel this has been fixed in https://github.com/jtblin/angular-chart.js/pull/453 merged a few days ago.

@pelted you need to use bower-npm-resolver now that Chart.js doesn't include the dist/ folder anymore.

Hi
I tried to install ChartJS using this npm-resolver and I got this
remote: Repository not found. fatal: repository 'https://github.com/centralway/chart.js.git/' not found

Why we can't use the old way anymore?

same issue

@sina-mirhejazi @MiszczProgramowania, bower should not try to access the git repository with this method. Also, the reported URL is weird, _https://github.com/centralway/chart.js.git_ doesn't exist and I don't think that _centralway_ has something to do with Chart.js (@etimberg, @tannerlinsley, @zachpanz88 ?). Did you guys followed _exactly_ the doc instructions?

Because of bower chart.js repository not found, i had problem with install other bower packages

This looks like a duplicate of #3033

Fixed in version 2.3.0, no need to use bower-npm-resolver anymore, native Bower support is back. Also, the chart.js bower package now points on the correct repository.

@jtblin looks like you will need to revert your bower-npm-resolver change :\

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benmccann picture benmccann  路  3Comments

JewelsJLF picture JewelsJLF  路  3Comments

joebirkin picture joebirkin  路  3Comments

lizbanach picture lizbanach  路  3Comments

akashrajkn picture akashrajkn  路  3Comments