{"action":"created","issue":{"url":"https://api.github.com/repos/siddharthkp/bundlesize/issues/218","repository_url":"https://api.github.com/repos/siddharthkp/bundlesize","labels_url":"https://api.github.com/repos/siddharthkp/bundlesize/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/siddharthkp/bundlesize/issues/218/comments","events_url":"https://api.github.com/repos/siddharthkp/bundlesize/issues/218/events","html_url":"https://github.com/siddharthkp/bundlesize/issues/218","id":315160136,"number":218,"title":"bundlesize failing because google api call 403ing.","user":{"login":"dzearing","id":1110944,"avatar_url":"https://avatars3.githubusercontent.com/u/1110944?v=4","gravatar_id":"","url":"https://api.github.com/users/dzearing","html_url":"https://github.com/dzearing","followers_url":"https://api.github.com/users/dzearing/followers","following_url":"https://api.github.com/users/dzearing/following{/other_user}","gists_url":"https://api.github.com/users/dzearing/gists{/gist_id}","starred_url":"https://api.github.com/users/dzearing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzearing/subscriptions","organizations_url":"https://api.github.com/users/dzearing/orgs","repos_url":"https://api.github.com/users/dzearing/repos","events_url":"https://api.github.com/users/dzearing/events{/privacy}","received_events_url":"https://api.github.com/users/dzearing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-17T17:33:30Z","updated_at":"2018-05-02T11:46:59Z","closed_at":null,"author_association":"NONE","body":"<!-- Please don't delete this template -->\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\nbug\r\n\r\n**What is the current behavior?**\r\nbundlesize doesn't work because of googleapi 403s.\r\n\r\nThe actual console logging shows this:\r\n```bash\r\nUnhandled Promise\r\nTypeError: Converting circular structure to JSON\r\n    at JSON.stringify (<anonymous>)\r\n    at debug (/Users/david/fabric/branch5/common/temp/node_modules/bundlesize/src/debug.js:7:41)\r\n    at shortener.shorten.then.catch.err (/Users/david/fabric/branch5/common/temp/node_modules/bundlesize/src/reporter.js:89:7)\r\n    at <anonymous>\r\n    at process._tickCallback (internal/process/next_tick.js:188:7)\r\n```\r\n\r\nThe real error occurs in this code, which has no error handling:\r\n\r\n```js\r\nconst shorten = longUrl =>\r\n  axios({\r\n    method: 'POST',\r\n    url: `${url}?key=${googleApiKey}`,\r\n    data: {\r\n      longUrl\r\n    }\r\n  })\r\n```\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\nRun bundlesize.\r\n\r\n<!-- A great way to do this is to provide your configuration via a GitHub gist. -->\r\n\r\n**What is the expected behavior?**\r\nhttps://github.com/siddharthkp/bundlesize/blob/master/src/shortener.js\r\nThis file has a hardcoded api key. Maybe it shouldn't be. It throws up now, blocking checkins.\r\n\r\n**If this is a feature request, what is motivation or use case for changing the behavior?**\r\nI would like bundlesize to work.\r\n\r\n**Please mention other relevant information.**\r\n- node version\r\n- npm version\r\n- Operating system\r\n- bundlesize version\r\n- CI you are using\r\n\r\n<!-- Love bundlesize? Please consider supporting our collective:\r\n👉  https://opencollective.com/bundlesize/donate -->"},"comment":{"url":"https://api.github.com/repos/siddharthkp/bundlesize/issues/comments/385950777","html_url":"https://github.com/siddharthkp/bundlesize/issues/218#issuecomment-385950777","issue_url":"https://api.github.com/repos/siddharthkp/bundlesize/issues/218","id":385950777,"user":{"login":"karanjthakkar","id":1824298,"avatar_url":"https://avatars3.githubusercontent.com/u/1824298?v=4","gravatar_id":"","url":"https://api.github.com/users/karanjthakkar","html_url":"https://github.com/karanjthakkar","followers_url":"https://api.github.com/users/karanjthakkar/followers","following_url":"https://api.github.com/users/karanjthakkar/following{/other_user}","gists_url":"https://api.github.com/users/karanjthakkar/gists{/gist_id}","starred_url":"https://api.github.com/users/karanjthakkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karanjthakkar/subscriptions","organizations_url":"https://api.github.com/users/karanjthakkar/orgs","repos_url":"https://api.github.com/users/karanjthakkar/repos","events_url":"https://api.github.com/users/karanjthakkar/events{/privacy}","received_events_url":"https://api.github.com/users/karanjthakkar/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T11:46:59Z","updated_at":"2018-05-02T11:46:59Z","author_association":"COLLABORATOR","body":"@siddharthkp That sucks! Did goog send you an email to inform you that the service may be shutting down? 🤔 Regardless I can see two options:\r\n\r\n1. Use another service 🤷‍♀️ like bitly or something\r\n2. extend the bundlesize now app to include two more endpoints:\r\n    - /shorten to shorten the url and save the hash to firebase (which we already have setup)\r\n    - /redirect/<hash> to fetch from firebase and redirect to that url (In fact, come to think of it, now that we have to make a change, it might be a good idea that [instead of saving the url, we directly save the `info` and render it at that hash url directly](https://github.com/siddharthkp/bundlesize/issues/80#issuecomment-318041620))\r\n"}}
{"actor":{"display_login":"karanjthakkar"}}