Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Module not found: Opensearch Errors #651

Closed
azwraithnp opened this issue Nov 23, 2023 · 2 comments
Closed

[BUG] Module not found: Opensearch Errors #651

azwraithnp opened this issue Nov 23, 2023 · 2 comments

Comments

@azwraithnp
Copy link

azwraithnp commented Nov 23, 2023

What is the bug?

I'm currently utilizing some types from @opensearch-project/opensearch/lib/errors namely

  • ConnectionError,
  • NoLivingConnectionsError,
  • RequestAbortedError,
  • ResponseError,

Running the code via Docker results in not being able to find the module. This is on NestJS. Didnt' face this issue before until the node version upgrade.

How can one reproduce the bug?

Importing a type from @opensearch-project/opensearch/lib/errors in the mentioned node version

What is your host/environment?

@types/node: ^20.0.0 from ^16.0.0
node:alpine3.17
Dockerfile

Do you have any screenshots?

image
image

@khaizaki-accesstel
Copy link

Facing the same issue upgrading node (from v16 to v18).

I managed to get the import working as such:

// import { ResponseError } from '@opensearch-project/opensearch/lib/errors';
import { errors } from '@opensearch-project/opensearch';

// access the class via the `errors`
errors.ResponseError

@azwraithnp
Copy link
Author

Facing the same issue upgrading node (from v16 to v18).

I managed to get the import working as such:

// import { ResponseError } from '@opensearch-project/opensearch/lib/errors';
import { errors } from '@opensearch-project/opensearch';

// access the class via the `errors`
errors.ResponseError

Thanks for the update, I fixed it in the same way. I believe, for now, this should be the way to go. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants