{"action":"created","issue":{"url":"https://api.github.com/repos/twosigma/beaker-notebook/issues/4949","repository_url":"https://api.github.com/repos/twosigma/beaker-notebook","labels_url":"https://api.github.com/repos/twosigma/beaker-notebook/issues/4949/labels{/name}","comments_url":"https://api.github.com/repos/twosigma/beaker-notebook/issues/4949/comments","events_url":"https://api.github.com/repos/twosigma/beaker-notebook/issues/4949/events","html_url":"https://github.com/twosigma/beaker-notebook/issues/4949","id":190367538,"number":4949,"title":"async calls","user":{"login":"brandonmp","id":14139991,"avatar_url":"https://avatars.githubusercontent.com/u/14139991?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonmp","html_url":"https://github.com/brandonmp","followers_url":"https://api.github.com/users/brandonmp/followers","following_url":"https://api.github.com/users/brandonmp/following{/other_user}","gists_url":"https://api.github.com/users/brandonmp/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonmp/subscriptions","organizations_url":"https://api.github.com/users/brandonmp/orgs","repos_url":"https://api.github.com/users/brandonmp/repos","events_url":"https://api.github.com/users/brandonmp/events{/privacy}","received_events_url":"https://api.github.com/users/brandonmp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-18T16:52:23Z","updated_at":"2016-11-18T22:23:49Z","closed_at":null,"body":"I'm using beaker notebook in the Beaker Lab environment, and it seems I'm unable to execute async calls in javascript. Is this a known limitation, or is there a setting I can adjust somewhere?\r\n\r\n\r\ne.g.:\r\n```\r\n// fetch headers \r\nfetch('http://www.google.com', \r\n      {method: 'HEAD'})\r\n  .then((res) => beaker.print(res))\r\n  .catch(err =>beaker.print(err))\r\n```\r\n\r\nresults in a perpetual 'loading' spinner:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/14139991/20438379/6df2e242-ad85-11e6-8ba9-c83b4b587591.png)\r\n\r\nthe `cancel` button doesn't work, have to reload the page to break the process.\r\n\r\n\r\nETA: \r\n- same issue if `console.log` is used instead of `beaker.print`\r\n- returning just the `res` or `err` results in a small blank table\r\n- `res` in this instance is of type `ObservableStream`, i believe, so i'm not sure if that complicates anything\r\n\r\n\r\nLooking @ console reveals an infinite loop of this error/stacktrace:\r\n\r\n```\r\nTypeError: Cannot read property 'innertype' of null\r\n    at Object.$scope.model.getOutputSummary (http://127.0.0.1:8805/4c05020/beaker/app/dist/beakerApp.js:16151:65)\r\n    at Scope.$scope.getOutputSummary (http://127.0.0.1:8805/4c05020/beaker/app/dist/beakerApp.js:12657:89)\r\n    at fn (eval at <anonymous> (http://127.0.0.1:8805/4c05020/beaker/app/dist/beakerVendor.js:63924:15), <anonymous>:4:239)\r\n    at expressionInputWatch (http://127.0.0.1:8805/4c05020/beaker/app/dist/beakerVendor.js:65017:31)\r\n    at Scope.$digest (http://127.0.0.1:8805/4c05020/beaker/app/dist/beakerVendor.js:66556:34)\r\n    at computeElapsed (http://127.0.0.1:8805/4c05020/beaker/app/dist/beakerOutputDisplay.js:3550:19)\r\n    at http://127.0.0.1:8805/4c05020/beaker/app/dist/beakerOutputDisplay.js:3554:11\r\n    at callback (http://127.0.0.1:8805/4c05020/beaker/app/dist/beakerVendor.js:61859:11)\r\n    at completeOutstandingRequest (http://127.0.0.1:8805/4c05020/beaker/app/dist/beakerVendor.js:55361:10)\r\n    at http://127.0.0.1:8805/4c05020/beaker/app/dist/beakerVendor.js:55637:7(anonymous function) @ beakerVendor.js:63042(anonymous function) @ beakerVendor.js:59717Scope.$digest @ beakerVendor.js:66583computeElapsed @ beakerOutputDisplay.js:3550(anonymous function) @ beakerOutputDisplay.js:3554callback @ beakerVendor.js:61859completeOutstandingRequest @ beakerVendor.js:55361(anonymous function) @ beakerVendor.js:55637\r\n```"},"comment":{"url":"https://api.github.com/repos/twosigma/beaker-notebook/issues/comments/261657975","html_url":"https://github.com/twosigma/beaker-notebook/issues/4949#issuecomment-261657975","issue_url":"https://api.github.com/repos/twosigma/beaker-notebook/issues/4949","id":261657975,"user":{"login":"scottdraves","id":963093,"avatar_url":"https://avatars.githubusercontent.com/u/963093?v=3","gravatar_id":"","url":"https://api.github.com/users/scottdraves","html_url":"https://github.com/scottdraves","followers_url":"https://api.github.com/users/scottdraves/followers","following_url":"https://api.github.com/users/scottdraves/following{/other_user}","gists_url":"https://api.github.com/users/scottdraves/gists{/gist_id}","starred_url":"https://api.github.com/users/scottdraves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottdraves/subscriptions","organizations_url":"https://api.github.com/users/scottdraves/orgs","repos_url":"https://api.github.com/users/scottdraves/repos","events_url":"https://api.github.com/users/scottdraves/events{/privacy}","received_events_url":"https://api.github.com/users/scottdraves/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T22:23:49Z","updated_at":"2016-11-18T22:23:49Z","body":"hi, thanks for reporting this issue.\r\n\r\nit does handle async, an example is in the JavaScript tutorial: https://lab.beakernotebook.com/publications/87a444cc-fb85-11e5-9870-6f83c54cb849?fullscreen=true\r\n\r\nbut it's set up to recognize a deferred value.\r\n\r\nhttps://github.com/twosigma/beaker-notebook/blob/master/core/src/main/web/plugin/evaluator/javaScript.js#L277\r\n\r\nI have to look at exactly what fetch returns to see why it's not working, will do that later."}}
{"actor":{"display_login":"scottdraves"}}