ERROR Error: Uncaught (in promise): ReferenceError: process is not defined
See original GitHub issueUsing Angular 6.0.2 and other up-to-date packages (s. package.json).
Migration from Elasticsearch 14.2.2 to 15.0.0 raised following error:
ERROR Error: Uncaught (in promise): ReferenceError: process is not defined
ReferenceError: process is not defined
at Log.push../node_modules/elasticsearch/src/lib/log.js.Log.addOutput (log.js:213)
at new Log (log.js:51)
at new Transport (transport.js:19)
at new EsApiClient (client.js:58)
at new Client (client.js:101)
at ElasticsearchService.push../src/app/services/elasticsearch.service.ts.ElasticsearchService.connect (elasticsearch.service.ts:33)
at new ElasticsearchService (elasticsearch.service.ts:28)
at _createClass (core.js:9260)
at _createProviderInstance$1 (core.js:9234)
at resolveNgModuleDep (core.js:9200)
at Log.push../node_modules/elasticsearch/src/lib/log.js.Log.addOutput (log.js:213)
at new Log (log.js:51)
at new Transport (transport.js:19)
at new EsApiClient (client.js:58)
at new Client (client.js:101)
at ElasticsearchService.push../src/app/services/elasticsearch.service.ts.ElasticsearchService.connect (elasticsearch.service.ts:33)
at new ElasticsearchService (elasticsearch.service.ts:28)
at _createClass (core.js:9260)
at _createProviderInstance$1 (core.js:9234)
at resolveNgModuleDep (core.js:9200)
at resolvePromise (zone.js:814)
at resolvePromise (zone.js:771)
at zone.js:873
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:4053)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
at drainMicroTaskQueue (zone.js:595)
My elasticsearch.service.ts looks like:
import { Injectable } from '@angular/core';
import { Client } from 'elasticsearch';
@Injectable()
export class ElasticsearchService {
private client: Client;
queryalldocs = {
'query': {
'match_all': {}
}
};
constructor() {
if (!this.client) {
this.connect();
}
}
private connect() {
this.client = new Client({
host: 'http://company.com:9200',
log: 'trace'
});
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
javascript - Uncaught ReferenceError: process is not defined
My script is very simple, I am just trying to use a basic function of node.js, so I cannot figure out what errors...
Read more >ReferenceError: “process is not defined” - GIMTEC
In this case, process is not defined in the browser environment, hence the error. The solution is to remove the reference to process...
Read more >process is not defined (NOT react-error-overlay ... - GitHub
Using the optional chaining operator with process ( process?.env ) throws a ReferenceError stating that process is not defined. I originally ...
Read more >"Uncaught ReferenceError: process is not defined" and the ...
The Uncaught ReferenceError: process is not defined happens when when a non-existent (here: process) variable is referenced .
Read more >Uncaught ReferenceError: process is not defined
The error Uncaught ReferenceError: process is not defined may happen when the code tries to get access to the process object that provides ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@spalger Thank you a LOT! I works with
elasticsearch-browser
!@delvedor I have an Angular application that currently uses a Java Web Service for a back end – I was thinking of converting it to an elasticsearch back end. Is this not possible without the security risk you mentioned? I was planning to use the Pack based authentication and access control. Is that not viable?