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

ssm error: Object has no member 'json' #83

Open
christopher-ab opened this issue Dec 5, 2023 · 1 comment
Open

ssm error: Object has no member 'json' #83

christopher-ab opened this issue Dec 5, 2023 · 1 comment

Comments

@christopher-ab
Copy link

christopher-ab commented Dec 5, 2023

I found an issue when trying to call getParameter method on ssm.js. It says Uncaught (in promise) TypeError: Object has no member 'json'. Any help is really appreciated

I guess the culprit is this (taken from https://jslib.k6.io/aws/0.11.0/ssm.js)

value: (t = Oe().mark((function e(t) {
                    var r, n, o, i = arguments;
                    return Oe().wrap((function(e) {
                        for (;;) switch (e.prev = e.next) {
                            case 0:
                                return r = i.length > 1 && void 0 !== i[1] && i[1], n = this.signature.sign({
                                    method: this.method,
                                    endpoint: this.endpoint,
                                    path: "/",
                                    headers: je(je({}, this.commonHeaders), {}, Re({}, C, "AmazonSSM.GetParameter")),
                                    body: JSON.stringify({
                                        Name: t,
                                        WithDecryption: r
                                    })
                                }, {}), e.next = 4, de().asyncRequest(this.method, n.url, n.body, {
                                    headers: n.headers
                                });
                            case 4:
                                return o = e.sent, this._handle_error(He.GetParameter, o), e.abrupt("return", Ne.fromJSON(o.json())); //this is the culprit
                            case 7:
                            case "end":
                                return e.stop()
                        }
                    }), e, this)
                }))
@oleiade
Copy link
Member

oleiade commented Dec 12, 2023

Hey @christopher-ab 👋🏻

Would you be able to provide us with an example script demonstrating how you use the library, and what your getParameter call looks like? That would be much appreciated to help us reproduce and try to debug the issue 🙇🏻

For reference, the source code for this method can be found there: https://github.com/grafana/k6-jslib-aws/blob/main/src/internal/ssm.ts#L54

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

2 participants