0

If in polymer project I add google-chart:
<link rel="import" href="../bower_components/google-chart/google-chart.html">
and trying to polymer build, then I'm getting following error messages:
error: Promise rejection: Error: no resolver found for https://www.gstatic.com/charts/loader.js

Looks like it is due to https://github.com/Polymer/polymer-cli/issues/261 issue.

Question is: how can I workaround this problem and successfully build project to deploy it to the web hosting?

Ed Ilyin
  • 221
  • 1
  • 6

2 Answers2

0

You could edit the file bower_components/google-chart/charts-loader.html to point instead to thisIsAReallyLongFileNameToUseAsABookmark.js, and then create a file in bower_components/google-chart/ called thisIsAReallyLongFileNameToUseAsABookmark.js so that it can properly resolve the file.

After the build you could search the file and swap it out to point to https://www.gstatic.com/charts/loader.js.

If the build is instead merging the js file itself, you put something like this in the file, and then just replace it with a script tag to pull in the external script:

var thisIsAReallyLongVarToUseAsABookmark = undefined;

Yes this is a slightly convoluted method, but as I can't find any documentation to ignore a specific file or folder in polymer-build, it seems there may not be too many other options yet.

Jsilvermist
  • 491
  • 7
  • 16
0

It was already resolved. Update your polymer cli will do.

https://github.com/Polymer/polymer-cli/issues/261

HW Siew
  • 973
  • 8
  • 16