oracle / oci-typescript-sdk

Oracle Cloud Infrastructure SDK for TypeScript and JavaScript
https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/typescriptsdk.htm
Other
68 stars 50 forks source link

Error: Cannot find module 'bunyan' #267

Closed slia-stryber closed 4 months ago

slia-stryber commented 5 months ago
npm install oci-objectstorage

import the module somewhere

import { ObjectStorageClient } from 'oci-objectstorage';

run the application

Error: Cannot find module 'bunyan'
Require stack:
- ***/node_modules/oci-common/lib/log.js
- ***/node_modules/oci-common/lib/retrier.js
- ***/node_modules/oci-common/lib/circuit-breaker.js
- ***/node_modules/oci-common/lib/utils.js
- ***/node_modules/oci-common/lib/headers.js
- ***/node_modules/oci-common/lib/helper.js
- ***/node_modules/oci-common/lib/signer.js
- ***/node_modules/oci-common/index.js
- ***/node_modules/oci-objectstorage/lib/client.js
- ***/node_modules/oci-objectstorage/index.js
...
jyotisaini commented 5 months ago

@slia-stryber Can you try running npm install bunyan ? That should solve the issue for now. However we will take a look internally as why bunyan logger is being used in the objectstorage client.

slia-stryber commented 5 months ago

@slia-stryber Can you try running npm install bunyan ? That should solve the issue for now. However we will take a look internally as why bunyan logger is being used in the objectstorage client.

Yes, definitely, but I belive that

"bunyan": "^1.8.15",

should be somewhere in the package.json.

Also I don't have USE_BUNYAN env variable.

jyotisaini commented 5 months ago

Yes thats correct. But we do not use Bunyan logger in the clients. if its is giving an error for missing module bunyan, the issue is not that module is missing from package.json but it should not have been used in the client in the first place. We will look in to it as why it's complaining for bunyan.

slia-stryber commented 5 months ago

Yes thats correct. But we do not use Bunyan logger in the clients. if its is giving an error for missing module bunyan, the issue is not that module is missing from package.json but it should not have been used in the client in the first place. We will look in to it as why it's complaining for bunyan.

https://github.com/oracle/oci-typescript-sdk/blob/e0cff556fe6cb1ab3ff790de61fce433c4deef36/lib/common/lib/log.ts#L10

vpeltola commented 5 months ago

This problem comes with version 2.79.1. As a workaround, I downgraded to 2.79.0, and the problem went away. It affects other modules, too, at least oci-common and oci-identity, but probably any of them.

jyotisaini commented 5 months ago

Hi @vpeltola This issue has been fixed in the latest release. Can you please upgrade the sdk version ot the latest and confirm it works for you?

NiviPari commented 4 months ago

Closing this issue as it is fixed with latest release . @vpeltola please feel free to reopen if incase you are still seeing this issue. Thanks !