Skip to content

Angular 6 Uncaught ReferenceError: process is not defined #691

Closed
@diegotham

Description

@diegotham

UPDATE FROM MAINTAINERS

The working workaround for this issue for now is to add:

(window as any).process = {
  env: { DEBUG: undefined },
};

/UPDATE FROM MAINTAINERS

to your polyfill.ts file in you Angular app

Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Angular does not provide a shim for "process" anymore (angular/angular-cli#9827 (comment)).

Error:

Uncaught ReferenceError: process is not defined
    at Object../node_modules/algoliasearch/src/AlgoliaSearchCore.js (vendor.js:175349)
    at __webpack_require__ (runtime.js:82)
    at Object../node_modules/algoliasearch/src/AlgoliaSearch.js (vendor.js:174675)
    at __webpack_require__ (runtime.js:82)
    at Object../node_modules/algoliasearch/src/browser/builds/algoliasearch.js (vendor.js:177945)
    at __webpack_require__ (runtime.js:82)
...

If the current behavior is a bug, please provide all the steps to reproduce and a minimal
JSFiddle example or a repository on GitHub that we can npm install
and npm start.

Just using the library in an Angular 6 throws the error

What is the expected behavior?
To use algoliasearch library in an Angular 6 app

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions