Browser: Uncaught ReferenceError: require is not defined adding elasticsearch to angular...

Discussão em 'Angular' iniciado por Krishna, Setembro 9, 2024.

  1. Krishna

    Krishna Guest

    Here is my Angular project with an Elasticsearch dependency, repo.

    The project functions properly without the Elasticsearch dependency. However, upon adding Elasticsearch logging and updating the files angular.json, webpack.config.ts, and tsconfig.ts as required, the application resolves all dependency issues during the build process but fails to load in the browser.

    Uncaught ReferenceError: require is not defined
    at 9172 (log.js":1:1)
    at __webpack_require__ (bootstrap:19:1)
    at 9548 (WebSocketClient.js:50:4)
    at __webpack_require__ (bootstrap:19:1)
    at __webpack_exec__ (external commonjs "zone.js":1:1)
    at external commonjs "zone.js":1:1

    Uncaught ReferenceError: require is not defined
    at 9780 (platform-browser":1:1)
    at __webpack_require__ (bootstrap:19:1)
    at 4913 (elastic.service.ts:5:23)
    at __webpack_require__ (bootstrap:19:1)
    at __webpack_exec__ (log.js":1:1)
    at log.js":1:

    Continue reading...

Compartilhe esta Página