# JavaScript Client

**URL:** <https://discuss.elastic.co/t/javascript-client/314803>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 20, 2022, 6:26pm UTC](https://discuss.elastic.co/t/javascript-client/314803 "2022-09-20T18:26:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbujold\_wr](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@kbujold\_wr](https://discuss.elastic.co/u/kbujold_wr)\
**Post date:** [September 20, 2022, 6:26pm UTC](https://discuss.elastic.co/t/javascript-client/314803/1 "2022-09-20T18:26:46Z")

</div>

Hi we have ELK on a server running 7.17.1

I am trying to use the [JavaScript Client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/master/client-connecting.html). I am following the instructions but I am getting this error

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/3/d3dbbc25c27898a766e6d07718813cd5d74eb2a7.png)

Where **buffer.constants** is undefined in file 'webpack:///node\_modules/@elastic/elasticsearch/lib/Transport.js'

```auto
const MAX_BUFFER_LENGTH = buffer.constants.MAX_LENGTH

```

This is what my app that used the JS ES Client is set to.

```auto
Angular CLI: 13.3.5
Node: 16.15.0
Package Manager: npm 8.5.5
OS: linux x64

Angular: <error>
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, platform-browser, platform-browser-dynamic, router

Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1303.5 (cli-only)
@angular-devkit/build-angular <error>
@angular-devkit/core 13.3.5 (cli-only)
@angular-devkit/schematics 13.3.5 (cli-only)
@angular/cli 13.3.5 (cli-only)
@schematics/angular 13.3.5 (cli-only)
rxjs 6.6.7 (cli-only)
typescript <error>
webpack <error>

package.json
  "devDependencies": {
    "@elastic/elasticsearch": "7.17",

  "dependencies": {
    "@types/elasticsearch": "^5.0.40",

```

Any idea what the issue could be be? Thank you,  
Kristine

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 18, 2022, 6:27pm UTC](https://discuss.elastic.co/t/javascript-client/314803/2 "2022-10-18T18:27:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
