{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-js/issues/663","repository_url":"https://api.github.com/repos/elastic/elasticsearch-js","labels_url":"https://api.github.com/repos/elastic/elasticsearch-js/issues/663/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-js/issues/663/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-js/issues/663/events","html_url":"https://github.com/elastic/elasticsearch-js/issues/663","id":324410103,"number":663,"title":"ERROR Error: Uncaught (in promise): ReferenceError: process is not defined","user":{"login":"holgerzer","id":6146286,"avatar_url":"https://avatars1.githubusercontent.com/u/6146286?v=4","gravatar_id":"","url":"https://api.github.com/users/holgerzer","html_url":"https://github.com/holgerzer","followers_url":"https://api.github.com/users/holgerzer/followers","following_url":"https://api.github.com/users/holgerzer/following{/other_user}","gists_url":"https://api.github.com/users/holgerzer/gists{/gist_id}","starred_url":"https://api.github.com/users/holgerzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holgerzer/subscriptions","organizations_url":"https://api.github.com/users/holgerzer/orgs","repos_url":"https://api.github.com/users/holgerzer/repos","events_url":"https://api.github.com/users/holgerzer/events{/privacy}","received_events_url":"https://api.github.com/users/holgerzer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-18T13:26:10Z","updated_at":"2018-05-21T17:04:36Z","closed_at":null,"author_association":"NONE","body":"Using Angular 6.0.2 and other up-to-date packages (s. [package.json](https://github.com/elastic/elasticsearch-js/files/2017044/package.json.txt)).\r\n\r\nMigration from Elasticsearch 14.2.2 to 15.0.0 raised following error:\r\n\r\n```\r\nERROR Error: Uncaught (in promise): ReferenceError: process is not defined\r\nReferenceError: process is not defined\r\n    at Log.push../node_modules/elasticsearch/src/lib/log.js.Log.addOutput (log.js:213)\r\n    at new Log (log.js:51)\r\n    at new Transport (transport.js:19)\r\n    at new EsApiClient (client.js:58)\r\n    at new Client (client.js:101)\r\n    at ElasticsearchService.push../src/app/services/elasticsearch.service.ts.ElasticsearchService.connect (elasticsearch.service.ts:33)\r\n    at new ElasticsearchService (elasticsearch.service.ts:28)\r\n    at _createClass (core.js:9260)\r\n    at _createProviderInstance$1 (core.js:9234)\r\n    at resolveNgModuleDep (core.js:9200)\r\n    at Log.push../node_modules/elasticsearch/src/lib/log.js.Log.addOutput (log.js:213)\r\n    at new Log (log.js:51)\r\n    at new Transport (transport.js:19)\r\n    at new EsApiClient (client.js:58)\r\n    at new Client (client.js:101)\r\n    at ElasticsearchService.push../src/app/services/elasticsearch.service.ts.ElasticsearchService.connect (elasticsearch.service.ts:33)\r\n    at new ElasticsearchService (elasticsearch.service.ts:28)\r\n    at _createClass (core.js:9260)\r\n    at _createProviderInstance$1 (core.js:9234)\r\n    at resolveNgModuleDep (core.js:9200)\r\n    at resolvePromise (zone.js:814)\r\n    at resolvePromise (zone.js:771)\r\n    at zone.js:873\r\n    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)\r\n    at Object.onInvokeTask (core.js:4053)\r\n    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)\r\n    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)\r\n    at drainMicroTaskQueue (zone.js:595)\r\n```\r\n\r\nMy elasticsearch.service.ts looks like:\r\n\r\n```\r\nimport { Injectable } from '@angular/core';\r\nimport { Client } from 'elasticsearch';\r\n\r\n@Injectable()\r\nexport class ElasticsearchService {\r\n\r\n  private client: Client;\r\n\r\n  queryalldocs = {\r\n    'query': {\r\n      'match_all': {}\r\n    }\r\n  };\r\n\r\n  constructor() {\r\n    if (!this.client) {\r\n      this.connect();\r\n    }\r\n  }\r\n\r\n  private connect() {\r\n    this.client = new Client({\r\n      host: 'http://company.com:9200',\r\n      log: 'trace'\r\n    });\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch-js/issues/comments/390717586","html_url":"https://github.com/elastic/elasticsearch-js/issues/663#issuecomment-390717586","issue_url":"https://api.github.com/repos/elastic/elasticsearch-js/issues/663","id":390717586,"user":{"login":"spalger","id":1329312,"avatar_url":"https://avatars1.githubusercontent.com/u/1329312?v=4","gravatar_id":"","url":"https://api.github.com/users/spalger","html_url":"https://github.com/spalger","followers_url":"https://api.github.com/users/spalger/followers","following_url":"https://api.github.com/users/spalger/following{/other_user}","gists_url":"https://api.github.com/users/spalger/gists{/gist_id}","starred_url":"https://api.github.com/users/spalger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spalger/subscriptions","organizations_url":"https://api.github.com/users/spalger/orgs","repos_url":"https://api.github.com/users/spalger/repos","events_url":"https://api.github.com/users/spalger/events{/privacy}","received_events_url":"https://api.github.com/users/spalger/received_events","type":"User","site_admin":false},"created_at":"2018-05-21T17:04:36Z","updated_at":"2018-05-21T17:04:36Z","author_association":"MEMBER","body":"Solid guess @holgerzer, but [`_.bindKey`](https://lodash.com/docs/4.17.10#bindKey) is an actual lodash function and the error is saying that `process` is not defined here: https://github.com/elastic/elasticsearch-js/blob/master/src/lib/log.js#L213\r\n\r\nCheckout https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/browser-builds.html. Using the `elasticsearch-browser` package should solve things for you as it is pre-built for use in the browser."}}
{"actor":{"display_login":"spalger"}}