Skip to content

调用SDK报错:nodejs.TypeError: Cannot read properties of undefined (reading 'getAccessKeyId') #20

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

Closed
NJU-JYH opened this issue Nov 2, 2023 · 0 comments

Comments

@NJU-JYH
Copy link

NJU-JYH commented Nov 2, 2023

我的代码:
import { Service } from 'egg'
import Sls20201230, * as $Sls20201230 from '@alicloud/sls20201230';
import * as $OpenApi from '@alicloud/openapi-client';
const sls = new Sls20201230(
new $OpenApi.Config({
accessKeyId: "",
secretAccessKey: "
",
endpoint: '***',
})
)
const req = new $Sls20201230.GetLogsV2Request()
req.from = from
req.to = to
req.query = appId: ${appId}
const { body } = await sls.getLogs("teambition", "open-api-gateway", req)
报错内容:
00:00:00&endTime=2023-11-02%2000:00:00&requestId] nodejs.TypeError: Cannot read properties of undefined (reading 'getAccessKeyId')
at Client.modifyRequest (/Users/jinyihao/Desktop/dev-center/node_modules/@[email protected]@@alicloud/gateway-sls/src/client.ts:36:40)
at Client.execute (/Users/jinyihao/Desktop/dev-center/node_modules/
@[email protected]@@alicloud/openapi-client/src/client.ts:1202:25)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Client.getLogsWithOptions (/Users/jinyihao/Desktop/dev-center/node_modules/@[email protected]@@alicloud/sls20201230/src/client.ts:9900:39)
at Client.getLogs (/Users/jinyihao/Desktop/dev-center/node_modules/
@[email protected]@@alicloud/sls20201230/src/client.ts:9906:12)
at SlsService.queryLog (/Users/jinyihao/Desktop/dev-center/app/service/app_log.ts:23:26)

@NJU-JYH NJU-JYH closed this as completed Nov 2, 2023
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

1 participant