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

Saving any skill with Google APIs will now fail if NPM dependencies change #2905

Open
attaboy opened this issue Mar 8, 2019 · 0 comments
Open

Comments

@attaboy
Copy link
Collaborator

attaboy commented Mar 8, 2019

It no longer seems possible to guarantee we have compatible versions of the Google API/client libraries, because google-auth-library depends on gtoken ^2.3.0, and gtoken 2.3.2 depends on gaxios, which is broken in node 6.10.

There is a hack we can use mentioned here: googleapis/gaxios#44 (comment)

Adding this code where the google-auth-library is used makes things run again, but the real solution is twofold:

  • switching to node 8
  • freezing NPM dependencies
const url = require('url'); // legacy Node6 url
const semver = require('semver');
class Node6CompatibilityURL {
  constructor(str) {
    this.url = url.parse(str);
    this.origin = this.url.protocol + '//';
    this.pathname = this.url.pathname ? this.url.pathname : '';
    this.search = this.url.search ? this.url.search : '';
    this.href = this.url.href ? this.url.href : '';
  }
}

if (semver.lt(process.version, '6.13.0')) {
  window = {};
  window.URL = Node6CompatibilityURL; // no warranty 😱 
}
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