{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/rxjs/issues/2422","repository_url":"https://api.github.com/repos/ReactiveX/rxjs","labels_url":"https://api.github.com/repos/ReactiveX/rxjs/issues/2422/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/rxjs/issues/2422/comments","events_url":"https://api.github.com/repos/ReactiveX/rxjs/issues/2422/events","html_url":"https://github.com/ReactiveX/rxjs/issues/2422","id":210599585,"number":2422,"title":"TypeScript compile error: 'Promise' only refers to a type, but is being used as a value here.","user":{"login":"Pappa","id":1115870,"avatar_url":"https://avatars1.githubusercontent.com/u/1115870?v=4","gravatar_id":"","url":"https://api.github.com/users/Pappa","html_url":"https://github.com/Pappa","followers_url":"https://api.github.com/users/Pappa/followers","following_url":"https://api.github.com/users/Pappa/following{/other_user}","gists_url":"https://api.github.com/users/Pappa/gists{/gist_id}","starred_url":"https://api.github.com/users/Pappa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pappa/subscriptions","organizations_url":"https://api.github.com/users/Pappa/orgs","repos_url":"https://api.github.com/users/Pappa/repos","events_url":"https://api.github.com/users/Pappa/events{/privacy}","received_events_url":"https://api.github.com/users/Pappa/received_events","type":"User","site_admin":false},"labels":[{"id":187400556,"url":"https://api.github.com/repos/ReactiveX/rxjs/labels/type:%20question","name":"type: question","color":"cc317c","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2017-02-27T20:38:22Z","updated_at":"2018-04-07T16:25:14Z","closed_at":"2017-02-28T07:25:38Z","author_association":"NONE","body":"I'm seeing the following compile error when trying to compile a small Angular/Rx project:\r\n\r\n```\r\n$ tsc -p .\r\nnode_modules/rxjs/Observable.d.ts(69,60): error TS2693: 'Promise' only refers to a type, but is being used as a value here.\r\nnode_modules/rxjs/operator/toPromise.d.ts(3,79): error TS2693: 'Promise' only refers to a type, but is being used as a value here.\r\n```\r\n\r\n**RxJS version: 5.2.0**\r\n\r\n**Code to reproduce:**\r\n\r\n`typings.json`\r\n\r\n```\r\n{\r\n  \"globalDependencies\": {\r\n    \"es6-shim\": \"registry:dt/es6-shim#0.31.2+20160726072212\"\r\n  }\r\n}\r\n```\r\n\r\n`tsconfig.json`\r\n\r\n```\r\n{\r\n  \"compilerOptions\": {\r\n    \"outDir\": \"./dist/js/\",\r\n    \"target\": \"es5\",\r\n    \"noImplicitAny\": false,\r\n    \"sourceMap\": true,\r\n    \"module\": \"commonjs\",\r\n    \"allowSyntheticDefaultImports\": true\r\n  },\r\n  \"include\": [\r\n    \"./src/**/*\",\r\n    \"./node_modules/typescript/lib/lib.es6.d.ts\"\r\n  ],\r\n  \"exclude\": [\r\n    \"node_modules\"\r\n  ]\r\n}\r\n```\r\n\r\n`Angular service (edited)`\r\n\r\n```\r\nimport Rx from 'rxjs/Rx';\r\nimport {angular, ng} from \"angular\";\r\n\r\nexport class TweetEvents {\r\n    requests = {\r\n        getSentiment: new Rx.Subject<string>()\r\n    }\r\n    responses = {\r\n        getSentimentSuccess: new Rx.Subject<Models.Sentiment>()\r\n    }\r\n    static $inject = [\r\n        \"$http\"\r\n    ];\r\n\r\n    constructor(\r\n        private $http: ng.IHttpService\r\n    ) { \r\n        this.initGetSentiment();\r\n    }\r\n\r\n    private initGetSentiment(): void {\r\n        this.requests.getSentiment\r\n        .flatMap((search: string) => {\r\n            return Rx.Observable.fromPromise(\r\n                this.$http({\r\n                    url: 'https://example.com'\r\n                  })\r\n            )\r\n        })\r\n        .subscribe((response) => {\r\n            this.responses.getSentimentSuccess.next(response);\r\n        });\r\n    }\r\n}\r\n\r\nangular.module(\"events\")\r\n    .service(\"TweetEvents\", TweetEvents);\r\n```\r\n\r\nI'm pretty stumped and can't find examples online of other people with seeing exactly the same issue."},"comment":{"url":"https://api.github.com/repos/ReactiveX/rxjs/issues/comments/379481576","html_url":"https://github.com/ReactiveX/rxjs/issues/2422#issuecomment-379481576","issue_url":"https://api.github.com/repos/ReactiveX/rxjs/issues/2422","id":379481576,"user":{"login":"kakins","id":14915247,"avatar_url":"https://avatars3.githubusercontent.com/u/14915247?v=4","gravatar_id":"","url":"https://api.github.com/users/kakins","html_url":"https://github.com/kakins","followers_url":"https://api.github.com/users/kakins/followers","following_url":"https://api.github.com/users/kakins/following{/other_user}","gists_url":"https://api.github.com/users/kakins/gists{/gist_id}","starred_url":"https://api.github.com/users/kakins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakins/subscriptions","organizations_url":"https://api.github.com/users/kakins/orgs","repos_url":"https://api.github.com/users/kakins/repos","events_url":"https://api.github.com/users/kakins/events{/privacy}","received_events_url":"https://api.github.com/users/kakins/received_events","type":"User","site_admin":false},"created_at":"2018-04-07T16:25:14Z","updated_at":"2018-04-07T16:25:14Z","author_association":"NONE","body":"I'm using Visual Studio with an Angular CLI-based project and experienced Typescript intellisense errors referring to this issue and several others.  In my case, I need to still target older browses (which apparently is what the \"es5\" settings is for).  \r\n\r\nThis is what I had to do for es2017:\r\n```\r\n\"compilerOptions\": {\r\n    \"target\" : \"es5\",\r\n    \"lib\": [\"es5\", \"es2017\", \"dom\"]\r\n}\r\n```"}}
{"actor":{"display_login":"kakins"}}